hoogsoadaky
New Member
I need to match the last integer in a string and capture possible elements before and after the last integer, assuming that the string can be composed of a single integer or a combination of text and/or integers.Let say that $str can be:
- '123' -> '' - 123 - ''
- 'abc 123' -> 'abc ' - 123
- 'abc 123 def' -> 'abc ' - 123 - ' def'
- 'abc 123 def 456' -> 'abc 123 def ' - 456
- etc.