Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: String matching and Regular Expressions

by Perlin_the_Red (Initiate)
on Sep 16, 2002 at 18:05 UTC ( #198322=note: print w/replies, xml ) Need Help??

in reply to String matching and Regular Expressions

I'm having a wicked time setting up a pattern for the following: I have a text doc that contains info like the following: <space> \\dir1\<return> group\name1<return> group\name2<return> group\name3<return> <space> \\dir2\<return> group\name4<return> group\name5<return> group\name6<return> <space> I need to go through the list and find the "group\name" I am searching for (using $search as a variable), dump all the info pertaining to where that group is to a file handle. For ex: If I am searching for "group\name5" , I want to return the following info: \\dir2\<return> group\name4<return> group\name5<return> group\name6<return> I've setup a pattern that looks for /^\s+.*($search).*\s+$/ using the /si at the end for any case and including line returns, but it never matches anything up. What is the secret with the /s and multiple input lines? Thanks!
  • Comment on Re: String matching and Regular Expressions

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://198322]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2017-09-25 21:52 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (291 votes). Check out past polls.