php - Capture number inside square brackets after # sign -
I have email subjects who have this section:
[message # 15]
I want to remove 15 numbers from the subject, how do I get it? Preferably use PHP, but any regex answer is acceptable.
You can use:
'/ \ [[ ^ #]] * # (\ D +) (? = \]) / '
and use the captured group # 1
Comments
Post a Comment