PHP Regex for this pattern

Need help with a regular expression.

1) Format:

 Advisor Geologist – HighMount Exploration & Production LLC – Oklahoma City, OK

I’d like to get the text between the last character and the dash. ie. Oklahoma City, OK. Note the text might contain multiple dashes.

Tried this:

~-([.*$]+)~

Trying to get between the dash and the end of the string (.*$). Need to know how to check for the last occurrence of the dash.

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories