PHP: Extracting a certain set of characters from a string
Posted on 2013-02-04
I'm trying to extract a certain number regardless of where it is at in a string returned in PHP from a SMTP reply. Some examples are:
sent (250 2.0.0 Ok: queued as EC81CCC9B0)
sent (Error 5.1.1 Hard Bounce: queued as EC81CCC9B0)
etc. The number I need extracted in these two cases are the 2.0.0 and 5.1.1 for example. The number will always be 5 in length, have 2 dots and 3 numeric numbers in it as provided.
Does anyone have any suggestions on how I can extract this easily, regardless of where it is at? Thanks!