10-20-2022 09:48 AM
Hi,
I`m looking for an Regular expression so it matches a string of 10 digits. and not more
The expression I found was ".........." but this also matches with 11 digits..
Online i found this one "^[0-9]{10}$" but this doesn`t work
Thanks
Solved! Go to Solution.
10-20-2022 10:28 AM
If in the middle of other chars:
[^0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][^0-9]
If on a line by itself:
^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$
Or mix both.
The syntax you wrote works with many regex engines, but the CVI search box doesn't accept the repetition operator (the curly brace is used for grouping expressions); and the RegExpr_Parse function works with the same syntax. If you need more powerful regexes in your code, there are plenty of open-source regex libs out there.