On Sat, May 02, 2009 at 01:05:30PM -0600, Doug McNutt wrote: > > That would need modification to handle the case there the letters > constituting $word appear within another "word" that has more characters > than $word. > > while (<>) { /\W$word\W/ or print } > > Is a start requiring that $word be surrounded by two non-word characters > but will fail when $word begins or ends a line.
This is exactly what the word boundary assertion is for: /\b$word\b/ Ronald --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To post to this group, send email to bbedit@googlegroups.com To unsubscribe from this group, send email to bbedit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/bbedit?hl=en If you have a specific feature request or would like to report a suspected (or confirmed) problem with the software, please email to "supp...@barebones.com" rather than posting to the group. -~----------~----~----~----~------~----~------~--~---