Reference
Next ❯Examples
- turned_in_notFlags
- turned_in_notPatterns
Patterns Used [abc] To match any character specified in the square brackets [^abc] To match any character other then in the square brackets [a-c] To match any character within the range specified in the square brackets [^a-c] To match any character other then, within the range in the square brackets . To match any single character, except line terminators \w To match any word character including underscore \W To match any non-word character \d To match any digit character \D To match any non-digit character \s To match any whitespace character including space, tab, vertical tab, new line, carriage return, form feed and Unicode spaces \S To match any non-whitespace character other than '\s' characters \ooo To match octal number \xhh To match 2 digit hexadecimal number \uhhhh To match 4 digit hexadecimal number \u{hhhh} To match extended hexadecimal number \n To match new line character \r To match carriage return character \t To match tab character \v To match vertical tab character \f To match form feed character \0 To match NUL character \ Used only with the characters creating special meaning and to be treated as individual character \b To match only if, before/after of x is not of the same type '\w' or '\W' \B To match only if, before/after of x is of same type '\w' or '\W' ^x To match x at the beginning of whole string x$ To match x at the end of whole string x* To match zero or more occurrences of x x+ To match at least one x x? To match zero or one occurrences of x x{N} To match exactly N sequence of x's x{N,} To match at least N sequence of x's x{N, M} To match N to M sequence of x's and N < M (x) To match x & remembers the match (?:x) To match x but don't remember the match \N To hold the reference of the match value by (x) x|y To match either x or y x(?=y) To match x only if x is followed by y x(?!y) To match x only if x is not followed by y
- turned_in_notProperties
Properties Used flags To get all the flags used in RegExp object global To check pattern is using 'g' (global) flag or not ignoreCase To check pattern is using 'i' (ignoreCase) flag or not lastIndex To get/set the index at which pattern starts the next match multiline To check pattern is using 'm' (multiline) flag or not source To get the pattern text sticky To check pattern is using 'y' (sticky) flag or not unicode To check pattern is using 'u' (unicode) flag or not
- turned_in_notReference Properties
Properties Used RegExp.$1-$9 To get Nth group substring match, where "N" can be from 1-9 RegExp.input ($_) To get the string against which a current regular expression is matched RegExp.lastParen ($+) To get the last group substring match RegExp.lastMatch ($&) To get the last matched substring RegExp.leftContext ($`) To get the substring preceding the most recent match RegExp.rightContext ($') To get the substring following the most recent match
- turned_in_notMethods
Methods Used exec() To find the first match test() To check for a match available in a string or not toString() To get the string value of the regular expression RegExp() To declare regular expression
❮ Prev Reference Properties
Next ❯Examples