Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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'


Comment on Re^3: regex - problem with the loop I believe or maybe the regex itself ?
Select or Download Code

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 studying the Monastery: (5)
As of 2015-07-05 08:15 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