DavidSzczesniak
12/4/2017 - 12:51 PM

Meta Characters Explanation

Quick intro to what the rest of the meta characters are used for.

# == The PERIOD stands for any character
/b.g/ # would match "bag", "big", "bug", etc, as well as "b.g" itself, even if its an '!'
# to match an actual dot, you need to escape it with a backslash.
# Another way to write 'any character except a newline' is \N

# == The PIPE "|" is used to provide alternatives ==
/good|bad/ # will match "good vibes" or "bad karma"

# == The PARENTHESES group matched elements ==
/(good|bad)example/ 
# is the same as searching simultaneously for
/good example/ or
/bad example/

# == The SQUARE BRACKETS indicate a class of characters ==
/^[abcdefg]/ #would match any strings beginning with the letters a through g. Short hand /^[a-g]/