This project has moved and is read-only. For the latest updates, please go here.

Regex "Find All" highlights number of characters in first match


To reproduce:
Make a file with the following lines

function ClassName:Fn1()
function ClassName:FunctionTwo()

Now do a Find and use this regex: function\s+((?'CName'\w+)\s*:)?\s(?'FName'\w+)
Select Find All

The second line is highlighted up through "function ClassName:Fun" rather than the whole match. Subsequent matches will all highlight to that length.

If the first match is longer than a subsequent match, the highlighting will continue past the end of the shorter match(es), at least with Virtual Space turned on.

This occurs without the named captures. It also occurs without the captures at all, actually. Simpler regex: function\s+(\w+\s


samarjeet27 wrote Jul 31, 2014 at 11:32 AM

When I use the regex 'function\s+(\w+\s:)?\s*\w+',
function ClassName is selected and it is the text that is what should be selected. Try regexpal
NOTE : Ynote Classic uses .NET Regular Expressions and Find All (to date) does not work with text on the same line