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

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -