/^From:.*?([\w.-]+@[\w.-]+)/

A

April

Non-greedy '.*?' --
 the code took:0.03332 wallclock secs ( 0.03 usr +  0.00 sys =  0..03 CPU)

Greedy '[^\w.-]*' --
 the code took:0.016902 wallclock secs ( 0.03 usr +  0.00 sys =  0.03 CPU)

impressive!
 
U

Uri Guttman

A> ? seems a pretty interesting quatifier in re. it relates to both
A> optional and non-greedy.

that is wrong thinking. one is a quantifier (0 or 1 of the previous
thing). the other is a modifier (makes the previous quantifier
non-greedy). don't assume any sort of relationship because of the use of
? for both of those roles.

<yes, i am back! :) verizon screwed over my usenet feed and i finally
switched to a free text one>

uri
 
A

April

  A> ? seems a pretty interesting quatifier in re.  it relates to both
  A> optional and non-greedy.

that is wrong thinking. one is a quantifier (0 or 1 of the previous
thing). the other is a modifier (makes the previous quantifier
non-greedy). don't assume any sort of relationship because of the use of
? for both of those roles.

ok.. welcome back then, though I don't know you were gone.
 
J

John W. Krahn

Uri said:
A> ? seems a pretty interesting quatifier in re. it relates to both
A> optional and non-greedy.

that is wrong thinking. one is a quantifier (0 or 1 of the previous
thing). the other is a modifier (makes the previous quantifier
non-greedy). don't assume any sort of relationship because of the use of
? for both of those roles.

<yes, i am back! :)

Welcome back. ;-)
verizon screwed over my usenet feed and i finally
switched to a free text one>

Don't you just hate it when that happens. :-(



John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,211
Messages
2,571,092
Members
47,693
Latest member
david4523

Latest Threads

Top