Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: regex expression help

by Trix606 (Monk)
on Nov 08, 2005 at 17:42 UTC ( #506816=note: print w/ replies, xml ) Need Help??


in reply to regex expression help

I am not quite sure from your question whether you are having a problem with the match itself, or simply are asking about printing what precedes the match.

As for the match I tried your code and sample data and it works, ( once you add a semi-colon after Found it\n").

You can print the contents of $` to get what precedes your match.

Check out perldoc perlvar for info on $` and other variables you can use with a regex and more.


Comment on Re: regex expression help
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-07-05 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls