Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 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 Changed 11 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

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

comment:2 Changed 11 years ago by trancexx

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 Changed 11 years ago by Valik

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 Changed 11 years ago by trancexx

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 Changed 11 years ago by Valik

It's called hyperbole, not banal.

comment:6 Changed 11 years ago by trancexx

Banalizing me and my writing. Using hyperboles as means.

... almost challenging. Nice.

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 ticket will remain with no owner.
Author


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

 
Note: See TracTickets for help on using tickets.