Allow custom regex flags
Fixes Issue #29
For example, match "word" without case sensitivity, match globally:
word/ig
If you want to match a literal slash, escape it with a backslash: \/