php - Match sub-strings that start with a character -


i want match parts of string start character (asterisk):

abc*defxyz => *def

abc*de*fxyz => *de, *f

tried preg_match_all('/[$\*a-z]+/', $string, $matches); doesn't seem work. *de*f on 2nd example

change regex : \*[a-z]+

http://regexr.com?34itc

your regex here : [$\*a-z]+ means string containing * , a-z characters, not mentioning start.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -