Update pattern.js

Adding the possibility to add modifier to a regex by entering a beginning and ending sign and i,g,m modifiers. Backwards compatible.