Regex stumper?

Randal L. Schwartz merlyn at stonehenge.com
Thu Jul 27 14:05:03 CDT 2000


>>>>> "Kari" == Kari Chisholm <karic at lclark.edu> writes:

Kari> while ($text =~ /\s([\w\-]+\@[\w\-]+\.[\w\-]+)\B/)
...
Kari> 	or at <a href=mailto:wwwadmin at lclark.ed>wwwadmin at lclark.ed</a>u, dude.
...
Kari> How come the final [\w\-] doesn't match the u in edu?

\B says you need a non-word boundary after the \w or \-.  So it matches
"ed" and then needs to have another letter after d, outside the match,
hence the "u" must stay out of the match.  Why is that \B there?  Did you
want \b instead?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
TIMTOWTDI



More information about the Pdx-pm-list mailing list