GregArtemides
Programmer
if (!ereg("([0-9]{9})\(xml)|(txt))","123457890.txt"
) echo "error!";
What's wrong with this regular expression? I need one that will check a filename has 9 numeric digits and a .txt or .xml extension.
The one above should echo the error since it's 10 digits long before the dot, but it doesn't work.
Where did I go wrong?
What's wrong with this regular expression? I need one that will check a filename has 9 numeric digits and a .txt or .xml extension.
The one above should echo the error since it's 10 digits long before the dot, but it doesn't work.
Where did I go wrong?