Maheshwaran Posted July 16, 2019 Share Posted July 16, 2019 Hi, I am trying to searching order of string match in PHP. I tried "preg_match_all" and it's works some case and not someother case. <?php $sd = "2:Inst:(Inp:low:():high:(UnDri)),.(Inp:low:(concat():high:(UnDriven)),.(Inp:low:((((1))((1)))):high:((Constant))),."; // this should not match.. $sd = "2:Inst:(Inp:low:():high:(UnDri)),.(Inp:low:(():high:(UnDriven)),.(Inp:low:((concat((1))((1)))):high:((Constant))),."; // This should match $tu = "(\binst\b)(,)(\blow\b)(.*)(\bconcat\b)(.*)(\bhigh\b)(.*)(\b(Constant)\b)"; if (preg_match_all("/$tu/i",$sd,$out,PREG_SET_ORDER)) { echo "GUI : $sd\n"; } else { } ?> Thanks, Maheshwaran B Link to comment Share on other sites More sharing options...
justsomeguy Posted July 16, 2019 Share Posted July 16, 2019 Neither of those match. You're telling it to look for "inst" between word boundaries, followed by a comma. That would match "inst:,", but not what you have. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now