dbmathis has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl while (<>) { # take one input line at a time chomp; if (/(dmathis@gmail.\w+)/) { print "Matched: |$`<$&>$'|\n"; # the special match vars } else { print "No match: |$_|\n"; } }
I am using dbmathis@domain.com with this example? No match: |I am using dbmathis@domain.com with this example?| I am using dmathis@gmail.org this time. Matched: |I am using <dmathis@gmail>.org this time.|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Qwestion about Automatic Match Variables
by Corion (Patriarch) on Sep 22, 2008 at 13:00 UTC | |
by dbmathis (Scribe) on Sep 22, 2008 at 13:39 UTC | |
by wol (Hermit) on Sep 22, 2008 at 14:27 UTC | |
|
Re: Qwestion about Automatic Match Variables
by wrinkles (Pilgrim) on Sep 22, 2008 at 14:34 UTC | |
|
Re: Qwestion about Automatic Match Variables
by wrinkles (Pilgrim) on Sep 22, 2008 at 14:33 UTC |