Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-10-21 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (95 votes), past polls