|
Posted by FFMG on 10/11/34 11:56
Hi,
I am looking for a word inside a bracket, the text is something like.
LINE1( A=10) some more text
LINE2( B=12) yet some more text
LINE3( A=13) and some more text
LINE4( B=14) and some more text
If I am looking for the value of 'A' in LINE1 then I would probably
do something like
/LINE1.*?\(.*?A=([^\)]).*?)/is
But if I am looking for a value that is not in the bracket but found in
another then it will return the value.
For example
/LINE1.*?\(.*?B=([^\)]).*?)/is
Would give me $1 = 12 even though B is in the next set of brackets.
How can I return the values found in the correct set of brackets? (and
nothing if it is not found).
Thanks
FFMG
Navigation:
[Reply to this message]
|