Reputation: 37
I want a REGEXP to use for mysql query.
I tried this regexp and use .*
to mark anything between and the $
to mark the end of the string.
Battlefield.*2$
and i get this result that is normal since "2" and "2142" are both ending in "2":
Battlefield 2
Battlefield :2
Battlefield: 2
Battlefield collection 2
Battlefield 2142
Battlefield : 2142
My target results is this:
Battlefield 2
Battlefield :2
Battlefield: 2
Battlefield collection 2
How can i get it?
Upvotes: 2
Views: 83
Reputation: 382160
If you don't want any other digit before the 2, then you can use
Battlefield.*\D2$
Upvotes: 3