URGENT How to access V2 regular expressions in JS?

A swapping-ground for Regular Expression syntax

URGENT How to access V2 regular expressions in JS?

Postby chrisjj » Fri Jul 11, 2025 3:07 pm

(Apropos viewtopic.php?p=20293#p20293 - posting here separately for visibility.)

How can I access v2 regular expressions in a JS script, please? I need V2's capture naming.

RegExp (1) provides v2 patterns on a check box, and it respects capture names:

Image
Image

But despite Help for JS Renaming's:

Code: Select all
regEx("text", "match", "replace")
  This function processes a regular expression [b]in the same way as it is done in section RegEx (1)[/b].
(my bold)

regEx() does not respect capture names:

Image
Image

Neither regEx2() nor regExV2() are available.

For all I can tell, this regEx behaviour may be a bug.

Any suggestions gratefully received.

Thanks.
chrisjj
 
Posts: 54
Joined: Wed Mar 30, 2011 5:26 pm

Re: URGENT How to access V2 regular expressions in JS?

Postby chrisjj » Fri Jul 11, 2025 3:09 pm

PS

Code: Select all
regEx(line, "^(?<n>Date.).*$", "\\1")


gives Date:, confirming at least capturing works.
chrisjj
 
Posts: 54
Joined: Wed Mar 30, 2011 5:26 pm

Re: URGENT How to access V2 regular expressions in JS?

Postby chrisjj » Fri Jul 11, 2025 3:27 pm

Please ignore this thread. I see the forum has cropped a pic to uselessness and prevents me from editing, so I will repost.
chrisjj
 
Posts: 54
Joined: Wed Mar 30, 2011 5:26 pm

Re: URGENT How to access V2 regular expressions in JS?

Postby chrisjj » Fri Jul 11, 2025 3:38 pm

Workedaround version at: viewtopic.php?f=3&t=7120
chrisjj
 
Posts: 54
Joined: Wed Mar 30, 2011 5:26 pm


Return to Regular Expressions