views:

148

answers:

2

In Dreamweaver the characters between a pair of forward slashes in a very simple calculation, like this:

var foo = Math.round(bar/3)+Math.floor(bar/2);

is read as a regex (at least by the syntax coloring). Will this break my code? Do I need to escape it somehow?

+4  A: 

Dreamweaver is getting confused. That code won't be interpreted as a regex.

Dave Ward
+4  A: 

That seems to be a major syntax highlighting bug in Dreamweaver. A single forward slash alone should not trigger the colouring for regular expressions. Use a different editor, such as Notepad2, or gedit.

Delan Azabani
A single forward slash doesn't do anything, it's the second one that causes the coloring.
Isaac Lubow
actually something like "<meta />" will break gedit's highlighter too :(
no