Skip to content
Rod edited this page Apr 8, 2015 · 1 revision

Welcome to the regex-compiler wiki!

pattern:

String or [String] — Represents a high-level pattern with variables (words) and literals (non-words) in it.

Every variable must have a corresponding property. If it's passed an empty object, then it will match its name. It can also take an array of possible words to match. In case it's not possible to construct the necessary pattern using given tools, it's possible to pass a regex as a property.

chars: (required if the object is not empty)

  • String — Chars separated by a space. It describes what characters the variable can contain.
  • [String] — Different matching options (example: ['http', 'https'])

Special characters

  • a..h - from a to h (translates to [a-h])
  • \\d — digits
  • \\s — spaces (translates to a space)
  • \\t — tabs

length:

String — represents a length rule.

  • 1 — one character (default)
  • 5-9 — from 5 to 9 characters (translates to {5,9})
  • 3+ — at least 3 characters (translates to {3,})
Clone this wiki locally