I have a string formed up by numbers and sometimes by letters.
Example AF-1234 or 345ww.
AF-1234
345ww
I have to get the numeric part and incre
Here's some Python code that does what you ask. Not too great on my PHP, but I'll see if I can convert it for you.
>>> import re >>> match = re.match(r'(\D*)(\d+)(\D*)', 'AF-1234') >>> match.group(1) + str(int(match.group(2))+1) + match.group(3) 'AF-1235'