I have a small exercise to do for Uni as part of a Perl tutorial. I've been trying to accomplish it but have hit a wall.
I have to do a search, within a string, for a 7 letter word that has 'pr' in it and has 'm' as the final letter. These can be both upper or lower case.
So far i have this....
This works great up until the 'm' on the end. I've tried many different variations and i know it's something to do with word boundaries, but i just can't get it to work. I'm close to screaming and my head hurts. Can anyone please point me in the right direction?
Thanks for any help.
I have to do a search, within a string, for a 7 letter word that has 'pr' in it and has 'm' as the final letter. These can be both upper or lower case.
So far i have this....
Code:
/(?=\b\w{7}\b)(\b\w*pr\w*\b)/gi
This works great up until the 'm' on the end. I've tried many different variations and i know it's something to do with word boundaries, but i just can't get it to work. I'm close to screaming and my head hurts. Can anyone please point me in the right direction?
Thanks for any help.