Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#760 closed Bug (No Bug)

Regular expression; NUL character in \x##

Reported by: trancexx Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.1 Severity: None
Keywords: Cc:

Description

It's about null character in \x## pattern. Not working for that one. Example with StringRegExpReplace()

$sString = "abc" & Chr(1) & "def" & Chr(1) & "ghi"

$sNewString = StringRegExpReplace($sString, "\x1", "")

ConsoleWrite("1. " & $sNewString & @CRLF) ; this is as expected



$sString = "abc" & Chr(0) & "def" & Chr(0) & "ghi"

$sNewString = StringRegExpReplace($sString, "\x0", "") 

ConsoleWrite("2. " & $sNewString & @CRLF) ; this is not

Help file suggests that it should work for any ascii character (hex code).
I guess this has nothing to do with bugs, it's more like undocumented feature.

Attachments (0)

Change History (6)

comment:1 by Valik, 17 years ago

Resolution: No Bug
Status: newclosed

Code works how I expect. The function doesn't claim to work on binary data (data with embedded terminators).

comment:2 by trancexx, 17 years ago

ok
I've switched to 3.3.0.0 yesterday and saw that new function StringToASCIIArray().
Strings procesed by that function can contain null character, and help file remark is mentioning end of the string there (not to be null char).
So, strings are converted to strings before regexp funtions. Then maybe when speaking of ascii characters and regular expression, it should be said somehow, that null character is that what it is.

comment:3 by Valik, 17 years ago

What should I document next? Should I document the function can't be used to make you toast? Or that the function is not suitable for use as a coffee filter? Documenting things functions can't do doesn't make sense. You can experiment and see if something works when it's not documented but don't come running to us if the experiment fails saying we need to document the results.

comment:4 by trancexx, 17 years ago

You are banalizing things to gain some sort of advantage. You don't have to do that. When it comes to this I'm no match for you. Football - maybe.

I recon your questions to be rhetorical ones.

comment:5 by Valik, 17 years ago

It's called hyperbole, not banal.

comment:6 by trancexx, 17 years ago

Banalizing me and my writing. Using hyperboles as means.

... almost challenging. Nice.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


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