in reply to Re: (nrd)Regex Help
in thread Parsing email addresses (was: Regex Help)
/\@(.+?)\s/;
That wouldn't match his example, "fake@email.com" due to the \s and the fact that his example has no whitespace. You also don't need to escape the @.
This:
/@(.*)/would work.
Note that, without anchoring the end of it, you must .* rather than .*? because the latter can (and would) match nothing (i.e. an empty match) and end.
Of course, I agree that you shouldn't use a regex for this anyway so caveats, disclaimers, etc. :-)
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: (nrd)Regex Help
by newrisedesigns (Curate) on Aug 29, 2002 at 12:30 UTC |