Oh peaceful ones, I have an array @titles = qw/Mr Mrs Ms Miss Dr Sir Lord Lady Rev/; To avoid the darkness of repetition and exult the glory of elegance, I would like to use it in the following regexp instead of retyping all the array elements: $text =~ /^(Mr|Mrs|Ms|Miss|Sir|Lord|Lady|Dr|Rev)\s+(.*)/) Please can anyone empower me with the knowledge?
In reply to Array within regexp? by jfrm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |