in reply to Regex to move prefix of strings to their end
The specific reason your regex didn't work is because you have "Guide" in the text and "guide" in the regex. You can get around this problem by using the /i option for case independant matching. You also don't need (and don't appear to want) the brackets on the replacement side of the s///.
Try that.C:\test>perl -e "$_='A Guide to Criminal Records Clearance for Prospec +tive Employees'; s/(A guide to )(.*)/$2 - $1/i; print" Criminal Records Clearance for Prospective Employees - A Guide to
Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Another RegEx poser
by UnderMine (Friar) on Nov 18, 2002 at 12:00 UTC |