I’m still a newb when it comes to using regular expressions. I am trying to set up a regular expression where “0” will never match if it is by itself. I have 5 test expressions. The last 4 should match and the first one shouldn’t. However I can seem to only get the middle3 to match. How can i set it to get the last one to match as well?
<?php
$data1='0';
$data2='New Triggered By Test 01';
$data3='Hello';
$data4='01 Test';
$data5='00';
$pattern='/[^0]{1}/';
echo preg_match($pattern,$data1);
echo preg_match($pattern,$data2);
echo preg_match($pattern,$data3);
echo preg_match($pattern,$data4);
echo preg_match($pattern,$data5)
?>
What you want to match is
0Try this one:
Commented:
Test script: