Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: matching substrings on each line

by grizzley (Chaplain)
on Oct 08, 2012 at 06:31 UTC ( #997748=note: print w/ replies, xml ) Need Help??


in reply to matching substrings on each line

Did I understand correctly, that you want to

  • find string until first space /^(.*?)\s(.*)/; ($left, $right) = ($1, $2);
  • split it by '-' characters @tokens=split /(?<=-)/, $left
  • and find each of the tokens in right side string for $token(@tokens) { @result = $right =~ /$token/g }
?


Comment on Re: matching substrings on each line
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-05 09:03 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 (61 votes), past polls