After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 680203 - JavaScript: regular expressions with modifiers are not recognized
JavaScript: regular expressions with modifiers are not recognized
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
3.4.x
Other Linux
: Normal minor
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2012-07-18 20:49 UTC by skeggse
Modified: 2015-03-04 11:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix regex modifiers in javascript.lang (1.02 KB, patch)
2015-02-17 19:11 UTC, Robert Whitebit
none Details | Review

Description skeggse 2012-07-18 20:49:35 UTC
gedit does not recognize Javascript regular expressions with modifiers, and thus will not properly apply syntax-highlighting.

Example:

The following line receives appropriate syntax highlighting:
var regex = /thing[0-9]/;

But this one doesn't:
var regex = /thing[0-9]/g;
Comment 1 André Klapper 2012-07-19 14:55:01 UTC
Which version is this about?
Comment 2 skeggse 2012-07-19 16:21:21 UTC
It looks like I'm running 3.4.1.
Comment 3 Paolo Borelli 2012-08-06 16:05:35 UTC
needs fixing in javascript.lang
Comment 4 Robert Whitebit 2015-02-17 19:11:25 UTC
Created attachment 297056 [details] [review]
Fix regex modifiers in javascript.lang

The only valid regex modifiers in javascript are g, i and m [1]. Changed regex modifiers from [iomx]*[neus]?[iomx]* to [gim]*

[1] http://www.w3schools.com/jsref/jsref_obj_regexp.asp
Comment 5 Sébastien Wilmet 2015-03-04 11:06:04 UTC
Thanks for the patch Robert, I've pushed it to the master branch:

https://git.gnome.org/browse/gtksourceview/commit/?id=a868a99acfcbc110266cfb09d1b87c994f4aa0c6