#!/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.|
In reply to Qwestion about Automatic Match Variables by dbmathis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |