foreach (@newlist) { $_ =~ s/[.](.*)/($section) }
The above code performs the transform cat.1 ---> cat(1) It also performs the transform ls.so.conf.5 ---> ld(5) # which is WRONG! Is there a way to generalize this regex so it does: cat.1 ---> cat(1) ld.so.conf.5 ---> ld.so.conf(5) Thanks
In reply to Generalizing a REGEX by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |