util: rename from utils, avoid RegExp literal
Rename imports.misc.utils to imports.misc.util for more consistency (eg, with shell-util). Also, use the string-based RegExp() constructor rather than a RegExp literal, since the literal is extremely difficult to parse correctly, and confuses emacs and probably other editors and thus messes up autoindentation, etc. https://bugzilla.gnome.org/show_bug.cgi?id=635089
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
|
||||
/* http://daringfireball.net/2010/07/improved_regex_for_matching_urls */
|
||||
const _urlRegexp = /\b(([a-z][\w-]+:(\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)([^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))/gi;
|
||||
const _urlRegexp = new RegExp('\b(([a-z][\w-]+:(/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)([^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))', 'gi');
|
||||
|
||||
// findUrls:
|
||||
// @str: string to find URLs in
|
Reference in New Issue
Block a user