P
Peter Janssens
Hi,
Original question.
I want to retrieve all occurences of a string "aa". So in the search string
"aaaa", I have to find it three times (aa)aa, a(aa)a, aa(aa).
How can I do that, using regular expressions in Perl?
The following solution (previous post) works fine but ...
/(a(?=(a)))/g
Suppose I want to search for aaa or aab in the string aaabaabaa.
I thaught the following will do the job: a(?=a)[ab].
But is doesn't.
Also, if you try something like aa[ab] it will find the first instance (aaa)
but
not the second (aab) in aaabaabaa.
Your help is appreciated.
Peter
Original question.
I want to retrieve all occurences of a string "aa". So in the search string
"aaaa", I have to find it three times (aa)aa, a(aa)a, aa(aa).
How can I do that, using regular expressions in Perl?
The following solution (previous post) works fine but ...
/(a(?=(a)))/g
Suppose I want to search for aaa or aab in the string aaabaabaa.
I thaught the following will do the job: a(?=a)[ab].
But is doesn't.
Also, if you try something like aa[ab] it will find the first instance (aaa)
but
not the second (aab) in aaabaabaa.
Your help is appreciated.
Peter