I have a string “Mod. 816-10 025” and I want to remove everything but the 816-10.
Conditions:
- The number in the center will always be ###-##
- It may not be 3 numbers – 2 numbers but it will always be space numbers dash numbers space
Can someone help me? I’ve tried like 5 different regex but no success.
If the conditions always remain, there is no need for RegEx:
Note: Using php native functions will usually be faster than the powerful RegEx.