- Understand why, without quotes around the $file = 1234567_-.txt it seems to drop the period before "txt" in the value for $file.
- And not sure why it seems that the first line of the IF statement doesn't match, do I have the regex pattern wrong?
Code: Select all
$file = 1234567_-.txt;
if (regexmatches($file, "(.*)_([0-9a-zA-Z\-]*)(\.)(txt)$") == "1") {
$fRegExPat = "(.*)_([0-9a-zA-Z\-]*)(\.)(txt)$";
}
else {
$fRegExPat = "No match";
}
echo $fRegExPat;
XYplorer Beta Club