in reply to regex - problem with the loop I believe or maybe the regex itself ?

hi trummelbummel,

..but I am reversing it for the above reasons to: dIonly c ....................................workset((.......)) and I need the items in the workset as well...

Maybe something like this could help:

use warnings; use strict; my $node = 'workset((ab;joiret;garg)) c wasdobao; erhgahufdgah; c workset((adsghl +ia) c aghaoeriarg;oi c aasdfgohaerg c workset(empty) c ah;sorguiaerg +c aoi;hgruio;ghaer c playA c dIonly '; my $modified = join q{ } => reverse split /\s+/ => $node; # you could print modified to see the reversed string if ( my @dat = $modified =~ /\(\(?(.+?)\)/g ) { print "@dat\n"; # prints empty adsghlia ab;joiret;garg }
You might have to look into the documentations mentioned by AnomalousMonk.
Hopes that helps.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
  • Comment on Re: regex - problem with the loop I believe or maybe the regex itself ?
  • Download Code