Should this find a 9 digit number?
$pattern = "/[0-9]{9}$/";
It doesn't work for me. update: woops, works if I take out the start of line, end of line things... I guess I don't understand what those do.
cupboy wrote:update: woops, works if I take out the start of line, end of line things... I guess I don't understand what those do.
update: woops, works if I take out the start of line, end of line things... I guess I don't understand what those do.
They assert that the match starts from the start of the line and end of the line respectively, i.e., they are useful if you want to check that the entire line (or input) is a 9 digit number. Since you want to find the number in some larger piece of text, they become a hindrance.