URGENT How to access V2 regular expressions in JS? Fixed.

A swapping-ground for Regular Expression syntax

URGENT How to access V2 regular expressions in JS? Fixed.

Postby chrisjj » Fri Jul 11, 2025 3:32 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 Image

even with RegExp (1) v2 checkmarked.

Neither regEx2() nor regExV2() is available.

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

Any suggestions gratefully received.

Thanks.

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

Return to Regular Expressions


cron