Regex (matching all, except the given String)
Posted: Tue Aug 07, 2012 7:52 am
Hi guys,
i am trying to get this regex running for several hours, but it wont work
.
I have to match all Strings except the ones with AB_*
Source Text: one, two, three, AB_user, four, five, six, AB_admin, seven, eight, nine, AB_michael, ten, AB_Stephanie, eleven, twelve, test
Match Pattern: .*?(?=AB_.*?,)
Result:
matches Array:(
[0] => Array
(
[0] => one, two, three,
[1] =>
[2] => AB_user, four, five, six,
[3] =>
[4] => AB_admin, seven, eight, nine,
[5] =>
[6] => AB_michael, ten,
[7] =>
)
but thats wrong!
The correct result is:
[0] => one, two, three,
[1] => four, five, six,
[2] => seven, eight, nine
[3] => ten
[4] => eleven, twelve, test
Please help!
greetz, mike
i am trying to get this regex running for several hours, but it wont work
I have to match all Strings except the ones with AB_*
Source Text: one, two, three, AB_user, four, five, six, AB_admin, seven, eight, nine, AB_michael, ten, AB_Stephanie, eleven, twelve, test
Match Pattern: .*?(?=AB_.*?,)
Result:
matches Array:(
[0] => Array
(
[0] => one, two, three,
[1] =>
[2] => AB_user, four, five, six,
[3] =>
[4] => AB_admin, seven, eight, nine,
[5] =>
[6] => AB_michael, ten,
[7] =>
)
but thats wrong!
The correct result is:
[0] => one, two, three,
[1] => four, five, six,
[2] => seven, eight, nine
[3] => ten
[4] => eleven, twelve, test
Please help!
greetz, mike