I need a bit of a help with regex, fro example I have these strings:
- "Dovolenka (8)"
- "Bol raz jeden život 26/26"
- "Parížski mohykáni č.1"
- "Vtipnejší vyhráva 1985; Deň tlače,rozhlasu a televízi"
And I need to get the numbers "8", "26", "1", but not the "1985" that's a year not a part number. I got this so far '/(\d+).?$/'
that works for picking the number but I do not know how to remove the string for preg_replace()
function, so it only returns the wanted numbers.
Edit: What if i wanted only the strings, so vice versa ?