$dr = qr/(?:dr\.|doctor)/; $gn = qr/(?:condoleeza)/; $sn = qr/(?:rice)/; / $dr \s+ $sn | $dr \s+ $gn \s+ $sn | $gn \s+ $sn /x
which can be simplified to:
$dr = qr/(?:dr\.|doctor)/; $gn = qr/(?:condoleeza)/; $sn = qr/(?:rice)/; /(?:$dr (?:\s+ $gn)? | $gn) \s+ $sn/x
Don't forget to escape the . in dr. to dr\.!
In reply to Re: Non-exclusive or in regexp?
by ikegami
in thread Non-exclusive or in regexp?
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |