Modify

Opened 11 years ago

Closed 11 years ago

#734 closed Feature Request (Completed)

Docs update for StringRegExpReplace()

Reported by: MrCreatoR Owned by: Valik
Milestone: 3.2.13.13 Component: Documentation
Version: Severity: Blocking
Keywords: RegExp Replace Back-Reference Cc:

Description

I think there is few things in the RegExp(Replace) engine's docs that should be updated, one is the back-reference of the "Replace" parameter.

For example, if we need to add some number to $1 (right after it) so the result will include the first found group and the added number, then we can do it like this:

$sRegExp_Res = StringRegExpReplace("Some string <NEEDED STRING 1> Some data", ".*<(.*)>.*", "${1}00")

MsgBox(0, "Result", $sRegExp_Res)

We don't know about it from the docs (it's taken from Perl RegExp methods).

If we remove the brakets of $1, then we get wrong results (expecting NEEDED STRING 100).
I think the docs needs to be updated, just add something like this:

replace - The text to replace the regular expression matching text with. To insert matched group text, \0 - \9 (or $0 - $9) can be used as back-references.

To seperate back-references from actual (replaced) numbers, wrap it with half-round brackets, i.e: "${1}5".

Here is the second line that was added.

Thanks.

Attachments (0)

Change History (3)

comment:1 Changed 11 years ago by TicketCleanup

  • Version 3.2.12.1 deleted

Automatic ticket cleanup.

comment:2 Changed 11 years ago by Valik

  • Owner set to Valik
  • Severity changed from None to Blocking
  • Status changed from new to accepted

comment:3 Changed 11 years ago by Valik

  • Milestone set to 3.2.13.13
  • Resolution set to Completed
  • Status changed from accepted to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Valik.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.