/Andres/
/yes|no/
/.un/
=> run, sun, fun
/b[aiu]g/
=> bag, big, bug
/[a-c]at/
=> aat, bat, cat
/[a-z0-9]/
/[^aeiou]/
/a+/
/go*/
/<h?1>/
=> <h1>
/^Andres/
/Andres$/
/\w/
=== /[A-Za-z0-9]+/
/\W/
=== /[^A-Za-z0-9]/
/\d/
=== /[0-9]/
/\D/
=== /[^0-9]/
/\s/
/\S/
/Oh{3,5}\sno/
=> Ohhh no, Ohhhh no, Ohhhhh no
/Oh{4,}\sno/
=> Ohhhh no, Ohhhhhhhhhhhhhhh no
/Oh{3}/
=> Ohhh
/favou?rite/
A positive lookahead will look to make sure the element in the search pattern is there, but won't actually match it. A positive lookahead is used as (?=...) where the ... is the required part that is not matched.
A negative lookahead will look to make sure the element in the search pattern is not there. A negative lookahead is used as (?!...) where the ... is the pattern that you do not want to be there. The rest of the pattern is returned if the negative lookahead part is not present.
Match passwords that are greater than 5 characters long, and have two consecutive digits.
/(?=\w{6})(?=\w*\d{2})/
Simple password checker that looks for between 3 and 6 characters and at least one number.
/(?=\w{3,6})(?=\D*\d)/
/P(engu|umpk)in/
Match a string that consists of only the same number repeated exactly three times separated by single spaces.
/^(\d+)\s\1\s\1$/
Write a regex fixRegex using three capture groups that will search for each word in the string one two three. Then update the replaceText variable to replace one two three with the string three two one and assign the result to the result variable. Make sure you are utilizing capture groups in the replacement string using the dollar sign ($) syntax.
let str = "one two three";
let fixRegex = /(one)\s(two)\s(three)/; // Change this line
let replaceText = "$3 $2 $1"; // Change this line
let result = str.replace(fixRegex, replaceText);
/ignorecase/i
/Repeat/g