Jump to content

PHP Regular Expression


Maheshwaran
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...