Thanks to all for your responses
As it turns out I had forgotten a case which all methods are having problems solving.
For example:
my $str = "05/04/2010 13:09:45 - A - somebody - ( ( my.my id >= 1 ) an
+d ( is-mother.to code intersects afunc(val1,val2,val3,val4) and ( is-
+father.to code intersects bfunc(val1,val2,val3,val4) )";
Krambambuli - Nice little one liner
cdarke - I do not have access to feature in this environment and in a very quick look at cpan I could not find what module had feature in it. Sorry, I did not pursue this example.
Marshell - I liked this, good small brute force example
repellent - This is really what I was looking for but like the others it is having problems with ( is-mother.to code intersects afunc(val1,val2,val3,val4).
my $str = "05/04/2010 13:09:45 - A - somebody - ( is-mother.to code in
+tersects afunc(val1,val2,val3,val4) )";
$VAR1 = [
'05/04/2010 13:09:45 - A - somebody - ',
[
'(',
' is-mother.to code intersects afunc',
[
'(',
'val1,val2,val3,val4',
')'
],
' ',
')'
]
];
String is balanced.
Since it seems that all are having issues with this one scenario I am thinking I will have to combine Parse::Balanced with some brute force operations.
One idea I have is to just
- Grab the portions of the line containing this unique pattern(s).
- Remove it from the line and deal with it seperately.
- Finish normally with whats left of the resulting line.
Unless someone can come up with a way to handle the line in it's entirety.
Result should be
my $str = "05/04/2010 13:09:45 - A - somebody - ( ( my.my id >= 1 )
and ( is-mother.to code intersects afunc(val1,val2,val3,val4) and ( i
+s-father.to code intersects bfunc(val1,val2,val3,val4) )";
my.my id >= 1
is-mother.to code intersects afunc(val1,val2,val3,val4)
is-father.to code intersects bfunc(val1,val2,val3,val4)
|