Checking regex against both the beginning and end of a string (mongodb r...

...egex requires a slash in both places), instead of the stopgap we were using at the beginning

@gfranczyk, can you please double check this change before I merge into master?