Supported Regex Syntax

A swapping-ground for Regular Expression syntax

Supported Regex Syntax

Postby Ric » Fri May 01, 2020 7:21 pm

Can anyone point to a good reference for the regex implementation in BRU?
Especially for the implementation of named capture groups. Thanks.
Ric
 
Posts: 10
Joined: Fri Apr 10, 2020 6:17 pm

Re: Supported Regex Syntax

Postby Admin » Mon May 04, 2020 2:43 am

Hi, at the moment it uses PCRE 1 (not PCRE 2)
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm

Re: Supported Regex Syntax

Postby Admin » Mon May 04, 2020 2:50 am

Instead in BRU Javascript , regular expressions support most of PCRE 2.
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm

Re: Supported Regex Syntax

Postby Ric » Tue May 12, 2020 3:45 am

Admin wrote:Instead in BRU Javascript , regular expressions support most of PCRE 2.


So, is there documentation of what is supported in the base version of BRU? It sorts of wastes time to continually experiment to find out the extent of "most".
Ric
 
Posts: 10
Joined: Fri Apr 10, 2020 6:17 pm

Re: Supported Regex Syntax

Postby Admin » Wed May 13, 2020 1:41 am

Hi, RegEx(1) uses PCRE 1. In the next release we are looking into if it is possible to upgrade to PCRE 2.
The Regular Expression functionality in BRU Javascript was developed later, and it basically supports all Reg Ex functionality you would be able to use in a modern Internet browser.
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm

Re: Supported Regex Syntax

Postby Ric » Wed May 13, 2020 4:45 am

Admin wrote:Hi, RegEx(1) uses PCRE 1. In the next release we are looking into if it is possible to upgrade to PCRE 2.
The Regular Expression functionality in BRU Javascript was developed later, and it basically supports all Reg Ex functionality you would be able to use in a modern Internet browser.

Thanks good to know.
PCRE1 defines named capture groups with one of these syntaxes:
(?<name>...) named capturing group (Perl)
(?'name'...) named capturing group (Perl)
(?P<name>...) named capturing group (Python)
I believe that BRU uses the first form, (?<name>...), in RegEx(1). Question is what is the syntax for a named back reference?
I have tried all of
\k<name> reference by name (Perl)
\k'name' reference by name (Perl)
\g{name} reference by name (Perl)
\k{name} reference by name (.NET)
(?P=name) reference by name (Python)
and none seem to work.
Can you identify the BRU named capture group backreference syntax?
Thanks.
Ric
 
Posts: 10
Joined: Fri Apr 10, 2020 6:17 pm

Re: Supported Regex Syntax

Postby Ric » Sun May 24, 2020 6:57 am

Anyone have any suggestions?
Ric
 
Posts: 10
Joined: Fri Apr 10, 2020 6:17 pm


Return to Regular Expressions