Fix regex string matching

The tests were not enough to actually catch that I
made a mistake when doing the regexp change.

Therefore, while I fixed the regex matching, I fixed
also the jade tests (IMO still not perfect, but other tests
aren't perfect as well).

Additionally, fixed coding style according to @BYK.