regex - PHP Regular expressions not working -


i've been using regexr.com build , test regular expressions use in php programs. however, 1 particular expression, seems work on website not in program , not sure why

i trying match eu label data (ex: g c 71) in following string:

"viking snowtech ii 165/70 r13 79t winterreifen auf lager  g c 71  dbkundenbewertung (2.00) 29,50 € details  in den einkaufswagen" 

the regular expression '#\s\w\s\w\s\d{1,}#' works fine on regexr.com finds no match in program

$eulab = $row_html -> plaintext;         if( preg_match('#\s\w\s\w\s\d{1,}#', $eulab)){             $insert['eulab'] =  $matches[0];          }else {             echo "no match";         } 

i've tried other expressions \s{1}[a-z]{1}\s{1}[a-z]{1}\s{1}\d{1,}\s{1} work on regexr find no match in program. encoding issue? or php syntax? no errors being thrown.

my problem browser displaying single whitespace when there more that. altered expression correct , worked.

problem solved @chris85 above

my final code , expression are:

        $eulab = $row_html -> plaintext;          if( preg_match('#\s\w\s+\w\s+\d+#', $eulab, $matches)){              $insert['eulab'] =  str_replace(" ", "", $matches[0]);         } 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -