Re: Retrieving word and sourounding text

2003-04-02 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: $word = "seminary"; I am trying to retrieve a word, and the surrounding text in a file. For example, read through a file for $word, and when matched, place in a variable the matching word, along with the 10 words preceding it and trailing it, and have it work over multi

RE: Retrieving word and sourounding text

2003-04-02 Thread David Olbersen
Jim, You could start by defining what a word is, using some regex: $wordRegex = qr/... something here .../; Then build up from there: ($match) = $input =~ /($wordRegex{10}\s$word\s$wordRegex{10})/; Just an idea. -- David Olbersen iGuard Engineer 11415 West Bernardo Co