NotionCommotion Posted April 20, 2017 Share Posted April 20, 2017 (edited) Is there a better way to do this? <?php $string='someStringWithoutWhitespace.captureThisStringAfterFirstPeriodAndBeforeWhitespaceOrEqualsign bla bla bla.bla bla'; preg_match('/\.([^\s=]+)/', $string, $matches); echo($matches[1]); Edited April 20, 2017 by NotionCommotion Quote Link to comment https://forums.phpfreaks.com/topic/303761-capture-string-after-period-and-before-whitespace-using-regex/ Share on other sites More sharing options...
dkub Posted April 20, 2017 Share Posted April 20, 2017 Looks about as succinct as you're going to get. Quote Link to comment https://forums.phpfreaks.com/topic/303761-capture-string-after-period-and-before-whitespace-using-regex/#findComment-1545683 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.