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

c# - Highlight all words containing a letter in a richtextbox -

java - MigLayout - selective component fill -

Admob interstitials not clickable on Nexus 5 (Android 4.4.2) -