Needs Perl version 5.10+ for \K operator:
Please see perlre, perlretut, perlrequick, and Perlmonks regex tutorials.c:\@Work\Perl\monks>perl -wMstrict -le "use 5.010; ;; for my $s ( '2 INT_NET Net : c_c', '2 INT_NET Net : b_c', '2 INT_NET Net : a_c', ) { printf qq{'$s' -> }; my ($net_name) = $s =~ m{ : \s* \K \w+ }xmsg; print qq{'$net_name'}; } " '2 INT_NET Net : c_c' -> 'c_c' '2 INT_NET Net : b_c' -> 'b_c' '2 INT_NET Net : a_c' -> 'a_c'
Give a man a fish: <%-(-(-(-<
In reply to Re: Print string next to pattern matching?
by AnomalousMonk
in thread Print string next to pattern matching?
by sumathigokul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |