Замучил уже с этими регэкспами


Code: Select all
// Remove strings ("..." and '...')
.replace(/"(\\.|[^"\\\n\r])*"/g, escaper)
.replace(/'(\\.|[^'\\\n\r])*'/g, escaper)
// Try remove simple regular expressions like /x*/ and /\/*x/
// We search for invalid divisions:
// x = /./; -> =
// if(/a/.test(b)) -> (
// a = [/a/, /b/] -> [ ,
// x = a && /b/test(c) -> & |
// x = a ? /b/ : /c/ -> ? :
// x = !/a/.test(b) -> !
.replace(
/([=(\[,&|?:!]\s*((\/\/[^\n\r]*[\n\r]+|\/\*[\s\S]*?\*\/)\s*)*)\/([^*\\\/\n\r]|\\[^\n\r])(\\\/|[^\/\n\r])*\//g,
// special chars line comments block comments regexp begin regexp end
function(s, prefix) {
return prefix + escaper(s.substr(prefix.length));
}
);
Есть такая идея:Infocatcher wrote:js.coder:
<pre>.replace(/\/\/qwe\//g, "//asd/")</pre>и<pre>.replace(/\/\/qwe\//g, "/asd/")</pre>
Комментарии изнутри строк вылезают.
Code: Select all
;--RegExp--
;16517=1+4+128+16384
16517 0 0 0 "/" "//" "" "" "/"
;16517=1+4+128+16384
16517 0 0 0 "/" "/*" "" "" "/"
;5=1+4
5 0 ${AREA} 0 "/" "/" "" "" ""
Code: Select all
;392=8+128+256
392 2 ${TAG} 0 "" "(" "" "0123456789_abcdefghijklmnopqrstuvwxyz" ""
Code: Select all
Quotes:
;======================================================================
;Flags Font Color Color Quote Quote Escape Quote Quote
; style text bkgrnd start end char include exclude
;======================================================================
;397=1+4+8+128+256
397 2 ${TAG} 0 "" "(" "" "" ""
Я так и подумал. Просто хотел для AutoIt-а замутить подсветку встроенных ф-ций одним цветом, ф-ций из идущих в дистрибутиве библиотек - другим, а пользовательских - третьим, чтоб сразу было видно откуда у них ноги растут.Приоритет у "Quotes:" выше, чем у "Words:"