in reply to Regex word options
Not exactly as you stated the problem, but an extensible approach:
C:\>perl -E "my @work=(\"I Arranged a meet.\", \"Transcribe this\"); for $work(@work) { if ($work =~ /Transcribe||Arranged/) { say $work; } } I Arranged a meet. Transcribe this C:\>
The \b does nothing useful as you state your problem; alternation is better done with an ||, ("or"). Solving the captures as you need them is left as an exercise.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Regex word options
by choroba (Cardinal) on Nov 01, 2012 at 09:11 UTC | |
by ww (Archbishop) on Nov 04, 2012 at 00:11 UTC |
In Section
Seekers of Perl Wisdom