The format of a regular expression can be rather complicated. To make sure you didn't miss some slash or quotation mark, place the caret within the expression you want to check, and press &shortcut:ShowIntentionActions;.
In the pop-up frame type a sample string that should match your regular expression. If the background turns green, the match occurred. If it turns red, your expression probably contains a mistake.