Hi,

I made a CLM for Awk[1] just for convenience and I came up with a regex to 
capture functions.

>From the CLM reference[2]:

> Because of the way BBEdit processes regular-expression patterns internally, 
> if you need to make backreferences in a pattern, you must use named 
> subpatterns instead of positional (numbered) backreferences

The pattern I've used has named backreferences of the ?& flavour but the 
functions aren't being picked up. I've checked it works as a pattern in Find so 
I'm just wondering if this kind of backref is okay? The pattern fails if I use 
?P= to refer back to it.

Any help or insights are much appreciated

 <key>BBLMScansFunctions</key><true/>
 <key>Function Pattern</key>
 <string><![CDATA[
 (?x: 
 (?>function[^\S]+)(?>\w+[^\S]*\()
 (?P<args>\s*(?:(?:\[\w+\])|\w+)?\s*(?:,(?&args))?)
 \)
 (?P<funcbody>
 \s*\{
 (?:
 [^}{]+
 |
 (?&funcbody)
 )*+
 \}
 )
 )
 ]]></string>

[1] https://github.com/yb66/BBEdit-Awk
[2] https://www.barebones.com/support/develop/clm.html

Regards,
iain

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/efebd07c-c246-4194-8256-e4932b2c0316%40www.fastmail.com.

Reply via email to