php - Regex doesn't get all before -
i have following string, want before a+.
am missing something?
string:
abcd www 6587 sm a+++ab regex:
([0-9a-za-z]*?) a\+ output:
sm a+ desired output:
abcd www 6587 sm solution:
([0-9a-za-z].*?) a\+ was missing . (dot)
use zero-width lookahead assertion
^.*(?=a\+)
Comments
Post a Comment