http://www.perlmonks.org?node_id=1001769


in reply to Regex word options

agree with ww. The '||' operator may be better suited here than the word boundary '\b'. Also, what are you trying with the '?' non-greedy quantifier? Are you looking for lines starting with these words? Perhaps I'm missing something, but you would probably benefit more from providing some input data.

Replies are listed 'Best First'.
Re^2: Regex word options
by falpizar91 (Initiate) on Nov 01, 2012 at 04:16 UTC

    why not try:

    if( $inputStr =~ /^(Arranged\,|Transcribe\,)/ ){ ### do your stuff }