Modify

Opened 17 years ago

Closed 17 years ago

#20 closed Bug (Rejected)

[:class:] in regex

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.2.10.0 Severity:
Keywords: regex, regexp, StringRegExpReplace Cc:

Description

StringRegExp says that [:space:] is recognized.

But this one works:

StringRegExpReplace($s,"(re:|fw:|fwd:)\s*","")

but these didn't:

StringRegExpReplace($s,"(re:|fw:|fwd:)[:space:]*","")
StringRegExpReplace($s,"
(re:|fw:|fwd:)([:space:])*","")

Change History (2)

comment:1 Changed 17 years ago by Xenobiologist

Hi,

works for me:

Global $s = "H e l l o"
ConsoleWrite(StringRegExpReplace($s,"\s","") & @CRLF)
ConsoleWrite(StringRegExpReplace($s,"[[:space:]]","")  & @CRLF)

So long,

Mega

comment:2 in reply to: ↑ description Changed 17 years ago by Jpm

  • Resolution set to rejected
  • Status changed from new to closed

Replying to anonymous:

StringRegExp says that [:space:] is recognized.

But this one works:

StringRegExpReplace($s,"(re:|fw:|fwd:)\s*","")

but these didn't:

StringRegExpReplace($s,"(re:|fw:|fwd:)[:space:]*","")
StringRegExpReplace($s,"
(re:|fw:|fwd:)([:space:])*","")

as stated by Mega there is no error as the [:space:] must me included in []. It is described in the doc

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

Author


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

 
Note: See TracTickets for help on using tickets.