#1 2016-02-21 18:56

Elektro
Senior Member
Registered: 2014-05-28
Posts: 76

RegEx Named Group example?

Hi!

Please den4b could you explain us how to use named groups for regular expressions in the script editor?.

I was looking for the proper syntax but I didn't found it, also I'm not sure if the scripts runs under pascal-script limitations, or Delphi/object-pascal limitations, could you clarify this too?.

How I could name a simple group like this?:

str        := "Hello World"
rgxPattern := '(Hello)'
rgxReplace := '$1 World'  

Thankyou.

Last edited by Elektro (2016-02-21 19:00)

Offline

#2 2016-02-23 12:49

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,479

Re: RegEx Named Group example?

Named groups are not supported by the current RegEx engine.

You can only reference groups by their index, i.e. $0, $1, $2, etc.

Reference: ReNamer:Regular_Expressions

Offline

Board footer

Powered by FluxBB