http://qs321.pair.com?node_id=153452


in reply to using Email::Find and URI::Find
in thread Look-behind regex to

Thank you for the tips. The URI Unfortunately, Email::Find chokes on those complex URIs containing usernames in those cases. Example output from that module:
An email address is <a href="mailto:foo-master@bar.com">foo-master@b +ar.com</a>, but this http:<a href="mailto://foo@bar.com">//foo@bar.com</a>/ and this ftp://foo:<a href="mailto:baz@bar.com">baz@bar.com</a>/ are not emails.
I wonder if one would have to copy some Email::Find code and modify it with a negative zero-width look-behind for (ht|f)tp:// ?

(p.s. my apologies for the unfinished node title! I got caught up with the code.)

Replies are listed 'Best First'.
Re: Re: using Email::Find and URI::Find
by hossman (Prior) on Mar 21, 2002 at 22:59 UTC
    I wonder if one would have to copy some Email::Find code and modify it with a negative zero-width look-behind for (ht|f)tp:// ?

    It's even easier then that.

    The docs for Email::Find have a section entitled "SUBCLASSING" that explains how you can make your own version with a different regex, or validation function. You can create a basic subclass that just defienes a new regex (with spaces before and after, and or enclosed in "<...>" -- whatever you want. "

•Re: Re: using Email::Find and URI::Find
by merlyn (Sage) on Mar 22, 2002 at 15:35 UTC