*** /usr/share/gtksourceview-2.0/language-specs/javascript.lang	2010-01-15 00:57:45.000000000 -0500
--- javascript.lang	2010-01-15 00:57:43.000000000 -0500
***************
*** 33,38 ****
--- 33,39 ----
      </metadata>
  
      <styles>
+         <style id="escape" _name="Escaped Character" map-to="def:special-char"/>
          <style id="comment" _name="Comment" map-to="def:comment"/>
          <style id="error" _name="Error" map-to="def:error"/>
          <style id="string" _name="String" map-to="def:string"/>
***************
*** 45,50 ****
--- 46,52 ----
          <style id="properties" _name="Properties" map-to="def:statement"/>
          <style id="constructors" _name="Constructors" map-to="def:type"/>
          <style id="future-words" _name="Future Reserved Keywords" map-to="def:error"/>
+         <style id="regex" _name="Regular Expression" map-to="def:identifier"/>
      </styles>
  
      <definitions>
***************
*** 324,330 ****
--- 326,365 ----
                      <keyword>volatile</keyword>
                  </context>
  
+                 <context ref="regex-simple"/>
+ 
              </include>
          </context>
+ 
+         <context id="escape" style-ref="escape">
+             <match>\\((0-7){3}|(x[a-fA-F0-9]{2})|(c\S)|([CM]-\S)|(M-C-\S)|.)</match>
+         </context>
+ 
+         <define-regex id="regex-opts">[iomx]*[neus]?[iomx]*</define-regex>
+ 
+         <context id="regex-bracketed" style-ref="escape" style-inside="true">
+             <start>(?&lt;!\\)[[]</start>
+             <end>(?&lt;!\\)]</end>
+         </context>
+ 
+         <context id="regex-simple" style-ref="regex">
+             <start extended="true">
+                 ((?&lt;=([(]|\s))|^)
+                 \/
+                 (?=
+                   ([^/\\]*(\\.))*
+                   [^/]*
+                   \/
+                   \%{regex-opts}
+                   ([),;.]|\s|$)
+                 )</start>
+             <end>\/\%{regex-opts}</end>
+             <include>
+                 <context ref="escape"/>
+                 <context ref="def:line-continue"/>
+                 <context ref="regex-bracketed"/>
+             </include>
+         </context>
+ 
      </definitions>
  </language>
