Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Answer: How do I match for a pattern in an array element delimited with a /

by nothingmuch (Priest)
on Oct 18, 2002 at 21:03 UTC ( #206431=categorized answer: print w/replies, xml ) Need Help??

Q&A > regular expressions > How do I match for a pattern in an array element delimited with a / - Answer contributed by nothingmuch

foreach (@array){ # iterate the array while(m#/MSS#g){ # find a /MSS substr($_,pos,do { m#/#g; pos }) =~ s/ (?!\*)//g; # find a closing / # substring the range currently in effect /MSS to / # replace all ' ' (replace with \s if applicable) # not followed by a * with nothing } }

  • Comment on Answer: How do I match for a pattern in an array element delimited with a /
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2017-04-25 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (449 votes). Check out past polls.