I'm documenting the .match() method for JavaScript, there are others.
/
by itself indicates the beginning and the end of the regex/^
combined with$/
means “ match the entire string” (rather than matching substrings that begin and/or end somewhere in the middle)- the
i
suffix is a modifier indicating that the match should be done in a case-insensitive manner [a-z0-9\-]
matches a character which is either a number, letter or dash (works for capital letters because of thei
at the end- the
+
indicates the match one or more of whatever came before - if you put a caret (
^
) inside of the match expression capturer thingamajig, it reverses the meaning