This matches one or more occurrences and is equivalent to {1,}.
/o+/ matches "oo" in "foo".
?
This matches zero or one occurrences and is equivalent to {0,1}.
/fo?/ matches "fo" in "foo" and matches "f" in "fairy".
+?
*?
"?" can also be used following one of the *, +, ?, or {} quantifiers to make the later match nongreedy, or the minimum number of times versus the default maximum.
/\d{2,4}?/ matches "12" in the "12345" string, instead of "1234" due to "?" at the end of the quantifier nongreedy.
x(?=y)
Positive lookahead: It matches x only if it's followed by y. Note that y is not included as part of the match, acting only as a required condition.
/Java(?=Script|Hut)/ matches "Java" in "JavaScript" or "JavaHut", but not "JavaLand".
x(?!y)
Negative lookahead: It matches x only if it's not followed by y. Note that y is not included as part of the match, acting only as a required condition.
/^\d+(?! years)/ matches "5" in "5 days" or "5 books", but not "5 years".