Fix scanner error with regular expressions

The scanner was failing to handle /=/ correctly.

Fixes #1105