SUMMARY *** When searching in regex mode, I can't use Non Capturing groups *** STEPS TO REPRODUCE 1. 2. 3. OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Neon 5.26 KDE Plasma Version: 5.26 KDE Frameworks Version: 5.100 Qt Version: 5.15.7 ADDITIONAL INFORMATION
Can you provide more info?
(In reply to Kurt Hindenburg from comment #1) > Can you provide more info? Of course, but it is an edge use case. I've a full screen konsole running a tail -f on a service log, when I'm publishing changes I usually put it into search to highlight some strings, now I'm searching for :app, app:, push: and 3000: (a quite simple regex), and what I'd love to achieve is to exclude the colon chat from the highlight using a "non capture group" in the regex. I know, I can and surely should, take my time to setup a custom grc config, as this FS Konsole has a dedicated monitor and is an important part of my job.
That's not what non-capturing groups are for. What you need for your use-case are look-around assertions (http://pcre.org/current/doc/html/pcre2pattern.html#SEC20). E.g. to not include a trailing colon: foo(?=:) To not include a leading colon: (?<=:)foo or its alias: :\Kfoo
(In reply to ninjalj from comment #3) > That's not what non-capturing groups are for. What you need for your > use-case are look-around assertions > (http://pcre.org/current/doc/html/pcre2pattern.html#SEC20). E.g. to not > include a trailing colon: > > foo(?=:) > > To not include a leading colon: > > (?<=:)foo > > or its alias: > > :\Kfoo You're right, and it works! I'm sorry. I'm closing this