Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 perusing the Monastery: (11)
As of 2014-09-16 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (43 votes), past polls