Hello!
Since stream.match() didn’t work in my case - i used a workaround:
indent preformatted text by 4 spaces
var regexP = /P\./g;
var regexRSDot = /RS\.\w*/g;
var regexDTDot = /DT\./g;
var regexDT = /DT_\w*/;
var regexRS = /RS_\w*/;
var regexFOAB = /FO\(AB\w*/;
var string = stream.string;
//var string = stream.string.replace(/^"(.*)"$/, '$1');
var matchC = regexComment.exec(string);
var matchP = regexP.exec(string);
var matchRS = regexRS.exec(string);
var matchRSDot = regexRSDot.exec(string);
var matchDTDot = regexDTDot.exec(string);
var matchDT = regexDT.exec(string);
var matchFOAB = regexFOAB.exec(string);
if(matchRS !== null){
return ret("ruleset", "ruleset");
}
The Regex Pattern will be recognized now. But unfortunately the whole line will be colorized and not just a subset.
Why does this statement colorize the whole line?
if(matchRS !== null){
return ret("ruleset", "ruleset");
}
How can I manage this?
Thank you.
Regards