Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Regex Help

Expand Messages
  • Jeff Boes
    ... Here s what you want: $_= My email address is . ; print $_ n ; print Match worked :$1: n if / /i; Broken down:
    Message 1 of 2 , Aug 23, 1998
    • 0 Attachment
      On Sun, 23 Aug 1998 17:26:17 -0500, hdesign <hdesign@...> wrote:

      >$_='My email address is <<<web@...>.';
      >print "$_ \n";
      >print "Match worked :$1:\n" if /(<*>)/i;

      Here's what you want:

      $_='My email address is <<<web@...>.';
      print "$_ \n";
      print "Match worked :$1:\n" if /<([^<]*)>/i;


      Broken down:

      < - matches a literal '<'

      () - contains the pattern returned in $1

      []* - defines a class of characters matched as a string

      ^< - matches anything BUT a '<'


      So the pattern says "Match '<', then zero or more characters which aren't a '<',
      and finally a '>'."



      --
      ~~~~~~~~~~~~~~~~|Fare Thee well now, let your
      Jeffery Boes |life proceed by its own design.
      jboes@... |Nothing to tell now, let your
      UIN 3394914 |words be yours, I'm done with mine...

      ____________________________________________________________
      List Site: http://www.findmail.com/list/perl-beginner/
      To unsubscribe, send to perl-beginner-unsubscribe@...

      FREE group e-mail lists at http://www.findmail.com
    Your message has been successfully submitted and would be delivered to recipients shortly.