Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • [0-9] = a char in range 0-9 (inclusive)

  • {5} = repeat the prior criteria 5 times

Example #3: Validating that a kit ID is either 6 digits or 6 digits with a space in the middle

(e.g., 012 293 or 012293):

[0-9]{3} ?[0-9]{3}

  • [0-9] = a char in range 0-9 (inclusive)

  • {3} = repeat the prior criteria 3 times

  • “ ?” = 0 or 1 spaces (? = match 0 or 1 of the preceding character, which in this case is a blank space)