i tried a repetition workaround which also failed: name=".{0,20}"
both of these regex constructs are extremely basic. without them regex becomes unusably clumsy. any chance to upgrade to scintilla v1.77 and utilize the new temp text buffer access for injecting proper regex support?
thanks,
Leon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>> "
Greedy and Lazy Repetition
The repetition operators or quantifiers are greedy. They will expand the match as far as they can, and only give back if they must to satisfy the remainder of the regex. The regex <.+> will match <EM>first</EM> in This is a <EM>first</EM> test.
Place a question mark after the quantifier to make it lazy. <.+?> will match <EM> in the above string.
A better solution is to follow my advice to use the dot sparingly. Use <[^<>]+> to quickly match an HTML tag without regard to attributes. The negated character class is more specific than the dot, which helps the regex engine find matches quickly.
RegEx in N++ does not support repeats ? or {x,y}. It means we have to be smarter about how we use RegEx. One thing to consider is making several passes.
We all want improvements to the RegEx functionality but at the moment all we have is what Scintilla provides.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
name=".*?"
are lazy operators "?" not supported at all?
i tried a repetition workaround which also failed: name=".{0,20}"
both of these regex constructs are extremely basic. without them regex becomes unusably clumsy. any chance to upgrade to scintilla v1.77 and utilize the new temp text buffer access for injecting proper regex support?
thanks,
Leon
Would just "lazy" be good enough?
name="[^"]*"
Suggestion: search the forums about regex and possibly greedy.
Or read this:
Copied from:
http://www.regular-expressions.info/quickstart.html
>> "
Greedy and Lazy Repetition
The repetition operators or quantifiers are greedy. They will expand the match as far as they can, and only give back if they must to satisfy the remainder of the regex. The regex <.+> will match <EM>first</EM> in This is a <EM>first</EM> test.
Place a question mark after the quantifier to make it lazy. <.+?> will match <EM> in the above string.
A better solution is to follow my advice to use the dot sparingly. Use <[^<>]+> to quickly match an HTML tag without regard to attributes. The negated character class is more specific than the dot, which helps the regex engine find matches quickly.
Learn more about greedy and lazy quantifiers
http://www.regular-expressions.info/repeat.html#greedy
" <<
RegEx in N++ does not support repeats ? or {x,y}. It means we have to be smarter about how we use RegEx. One thing to consider is making several passes.
We all want improvements to the RegEx functionality but at the moment all we have is what Scintilla provides.