Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: String matching and Regular Expressions

by Perlin_the_Red (Initiate)
on Sep 16, 2002 at 18:05 UTC ( [id://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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://198322]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-26 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found