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

Re^3: regex - problem with the loop I believe or maybe the regex itself ?

by shmem (Canon)
on Feb 12, 2014 at 18:18 UTC ( #1074660=note: print w/ replies, xml ) Need Help??


in reply to Re^2: regex - problem with the loop I believe or maybe the regex itself ?
in thread regex - problem with the loop I believe or maybe the regex itself ?

So firstly, one question, if I put the string into an array separated by a delimiter space, will reversing it reverse the characters itself as well? i thought this is only happening if it is a string, but not with a list?

See reverse. In scalar context, reverse will reverse a string, in list context, reverse reverses a list. If you want both, use

@yra = reverse map { scalar reverse $_ } @ary;

update: if you want to match parens, don't escape the backslash.

- if ($str =~ /\bdIonly:\b(.*?)\bworkset\b\\(\\(/g); + if ($str =~ /\bdIonly:\b(.*?)\bworkset\b\(\(/g);
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2016-06-29 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (378 votes). Check out past polls.