matches("121345", "\\d{3}.*")
Returns false?
Problem with matches?
Moderator: Martin
Re: Problem with matches?
Hi,
Curly braces within a string with double quotes are replaced by the variable or calculated value so your effectively executing this:
matches("121345", "\\d3.*")
You can avoid this by using single quotes:
matches("121345", '\\d{3}.*')
Regards,
Martin
Curly braces within a string with double quotes are replaced by the variable or calculated value so your effectively executing this:
matches("121345", "\\d3.*")
You can avoid this by using single quotes:
matches("121345", '\\d{3}.*')
Regards,
Martin
Re: Problem with matches?
Oh god! Thanks a lot. Sometimes one misses the obvious.