Jump to content
Sign in to follow this  

PHP Regular Expression

Recommended Posts


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.


$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 {





Maheshwaran B

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...