[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: What's the best way of parsing this string?

Carlos

2/13/2007 2:53:00 PM

Robert Dober wrote:
[...]
> Well it might be necessary to use a non greedy match
>
> /<param.*value="(.*?)"/
>
> in order not to consume a potentially following key="..." pair.
>
> A more explicit and thus more readable way might be to write it like this -
> avoiding any potential backtracking issues if the regexp evolves later too.
>
> /<param.*value="([^"]*)"/

Your advice of using a non greedy match is good, but the example using a
greedy match is not ;)

your_re =~ '<parameter value="1"/> ... bla bla bla ... value="ha!"'
puts $1

Greetings.
--



3 Answers

BIG Bird

1/6/2013 4:34:00 PM

0


"Robert" <jungleandy1@hotmail.com> wrote in message
news:90fc73cb-a379-415b-a9b8-91a652914c4c@w3g2000yqj.googlegroups.com...
: On Jan 6, 9:44 am, Gary <n...@none.com> wrote:
: > How college students think they are more special than EVER: Study
: > reveals rocketing sense of entitlement on U.S. campuses
: >
: >
: > http://www.dailymail.co.uk/news/article-2257715/Study-shows......
:
: It's amazing how someone living in their parent's basement, with
: no job, and no prospects since the "college degree" their parents
: paid for them to obtain isn't something that they can make
: a living with..... considers themselves to be more "worthy"
: than their parents. .... and to have all the answers to the
: political and social problems, in spite of their parent's
: stupidity.....
:


they sound like a bunch of right wing,hillbilly and republican trailer trash


GLOBALIST

1/6/2013 5:13:00 PM

0

On Sunday, January 6, 2013 9:54:14 AM UTC-6, Robert wrote:
> On Jan 6, 9:44 am, Gary <n...@none.com> wrote:
>
> > How college students think they are more special than EVER: Study
>
> > reveals rocketing sense of entitlement on U.S. campuses
>
> >
>
> > Books aside, if you asked a college freshman today who the Greatest
>
> > Generation is, they might respond by pointing in a mirror.
>
> >
>
> > Young people's unprecedented level of self-infatuation was revealed in
>
> > a new analysis of the American Freshman Survey, which has been asking
>
> > students to rate themselves compared to their peers since 1966.
>
> >
>
> > Roughly 9 million young people have taken the survey over the last 47
>
> > years.
>
> >
>
> > Pyschologist Jean Twenge and her colleagues compiled the data and
>
> > found that over the last four decades there's been a dramatic rise in
>
> > the number of students who describe themselves as being 'above
>
> > average' in the areas of academic ability, drive to achieve,
>
> > mathematical ability, and self-confidence.
>
> >
>
> > But in appraising the traits that are considered less invidualistic -
>
> > co-operativeness, understanding others, and spirituality - the numbers
>
> > either stayed at slightly decreased over the same period.
>
> >
>
> > Researchers also found a disconnect between the student's opinions of
>
> > themselves and actual ability.
>
> >
>
> > While students are much more likely to call themselves gifted in
>
> > writing abilities, objective test scores actually show that their
>
> > writing abilities are far less than those of their 1960s counterparts.
>
> >
>
> > continued -- (good pictures)
>
> >
>
> > http://www.dailymail.co.uk/news/article-2257715/Study-shows......
>
>
>
> It's amazing how someone living in their parent's basement, with
>
> no job, and no prospects since the "college degree" their parents
>
> paid for them to obtain isn't something that they can make
>
> a living with..... considers themselves to be more "worthy"
>
> than their parents. .... and to have all the answers to the
>
> political and social problems, in spite of their parent's
>
> stupidity.....

Just the facts predicted way before this time.
This generation will not have half of what the baby boomers had.

Runge 667

1/6/2013 5:16:00 PM

0

Lol GLOBALIST and other old farts

"GLOBALIST" <free.tuneup@gmail.com> a ?crit dans le message de groupe de
discussion : 501008ed-fb28-47f3-92f0-91efc040f160@googlegroups.com...
> On Sunday, January 6, 2013 9:54:14 AM UTC-6, Robert wrote:
>> On Jan 6, 9:44 am, Gary <n...@none.com> wrote:
>>
>> > How college students think they are more special than EVER: Study
>>
>> > reveals rocketing sense of entitlement on U.S. campuses
>>
>> >
>>
>> > Books aside, if you asked a college freshman today who the Greatest
>>
>> > Generation is, they might respond by pointing in a mirror.
>>
>> >
>>
>> > Young people's unprecedented level of self-infatuation was revealed in
>>
>> > a new analysis of the American Freshman Survey, which has been asking
>>
>> > students to rate themselves compared to their peers since 1966.
>>
>> >
>>
>> > Roughly 9 million young people have taken the survey over the last 47
>>
>> > years.
>>
>> >
>>
>> > Pyschologist Jean Twenge and her colleagues compiled the data and
>>
>> > found that over the last four decades there's been a dramatic rise in
>>
>> > the number of students who describe themselves as being 'above
>>
>> > average' in the areas of academic ability, drive to achieve,
>>
>> > mathematical ability, and self-confidence.
>>
>> >
>>
>> > But in appraising the traits that are considered less invidualistic -
>>
>> > co-operativeness, understanding others, and spirituality - the numbers
>>
>> > either stayed at slightly decreased over the same period.
>>
>> >
>>
>> > Researchers also found a disconnect between the student's opinions of
>>
>> > themselves and actual ability.
>>
>> >
>>
>> > While students are much more likely to call themselves gifted in
>>
>> > writing abilities, objective test scores actually show that their
>>
>> > writing abilities are far less than those of their 1960s counterparts.
>>
>> >
>>
>> > continued -- (good pictures)
>>
>> >
>>
>> > http://www.dailymail.co.uk/news/article-2257715/Study-shows......
>>
>>
>>
>> It's amazing how someone living in their parent's basement, with
>>
>> no job, and no prospects since the "college degree" their parents
>>
>> paid for them to obtain isn't something that they can make
>>
>> a living with..... considers themselves to be more "worthy"
>>
>> than their parents. .... and to have all the answers to the
>>
>> political and social problems, in spite of their parent's
>>
>> stupidity.....
>
> Just the facts predicted way before this time.
> This generation will not have half of what the baby boomers had.