extracting specific information from a string in PHP

I have a bunch of entries in a database where one field (varchar) is of this format

First name Last Name (AccountId-ItemId)

For example

“John Smith (1342-314)”

I needed to extract the Account and Item id’s from this.

Which gives you the 1324-314, Then I simply

I highly recommend RegExpBuddy if you want to create custom regular expressions. It’s a very handy tool.

Be the first to comment

Leave a Reply

Your email address will not be published.


*