Modify

Opened 16 years ago

Closed 16 years ago

#1669 closed Bug (Fixed)

RegExpReplace strips "\" from replacement string

Reported by: ResNullius Owned by: J-Paul Mesnage
Milestone: 3.3.7.0 Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: StringRegExpReplace Cc:

Description

Win 7 Pro & AutoIt 3.3.6.1

StringRegExpReplace strips backslashes from the replacement string. Doesn't appear to affect other special RegExp control characters in the replacement string

$str = "%CommonProgramFiles%\Microsoft Shared\"
MsgBox(0,"","Just to show that other special RegExp characters can be used in the replace string" & @CRLF & @CRLF & StringRegExpReplace($str, "%([^%]*?)%", "(?i)(?:^.*[0-9]$)"))
MsgBox(0,"","But the blackslashes get stripped from the replace string here: " & @CRLF & @CRLF & StringRegExpReplace($str, "%([^%]*?)%", "C:\WINDOWS\Some Other Folder"))

Attachments (0)

Change History (2)

comment:1 by J-Paul Mesnage, 16 years ago

In fact doc must be updated as back-references use "\". So they must be doubled in the replace string.

comment:2 by J-Paul Mesnage, 16 years ago

Milestone: 3.3.7.0
Owner: set to J-Paul Mesnage
Resolution: Fixed
Status: newclosed

Fixed by revision [5871] in version: 3.3.7.0

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.