As per I understand from this SO post, to support Regex balanced parentheses, it must support assign and delete variable on-the-fly such as (?<var>) and (?<-var>)
I see that AHK Regex can remove option on-the-fly such as (?-im), but how about variable?
Is it possible with AHK Regex?
Does AHK Regex support balanced parentheses?
Re: Does AHK Regex support balanced parentheses?
AutoHotkey uses PCRE, which supports subroutines and recursive calls. Subroutines can be used to match balanced parentheses.
This PCRE pattern solves the nested parentheses problem (assume the PCRE_EXTENDED option is set so that white space is ignored):https://www.pcre.org/original/doc/html/pcrepattern.html#subpatternsassubroutinesCode: Select all
\( ( [^()]++ | (?R) )* \)
Re: Does AHK Regex support balanced parentheses?
Thank you for quick reply!lexikos wrote: ↑06 Oct 2022, 19:27AutoHotkey uses PCRE, which supports subroutines and recursive calls. Subroutines can be used to match balanced parentheses.This PCRE pattern solves the nested parentheses problem (assume the PCRE_EXTENDED option is set so that white space is ignored):https://www.pcre.org/original/doc/html/pcrepattern.html#subpatternsassubroutinesCode: Select all
\( ( [^()]++ | (?R) )* \)
I'll absolutely check the link today!