regex - Controlling number of characters in expression? -
can somehow limit number of characters of whole expression?
i want limit number of characters in expression like:
([0-9]+(\.?[0-9]+)*) i want strings following limit accepted. example, if limit 4:
12.3gets accepted012doesn't12345doesn't.
use anchored ahead (for example max 33):
^(?=.{0,33}$)([0-9]+(\.?[0-9]+)*) to make exactly 33, remove 0,
to ignore number of periods in limit
^(?=(\.*[^.]){0,33}\.*$)([0-9]+(\.?[0-9]+)*)
Comments
Post a Comment