Thread overview
regex escapes
Feb 16, 2011
spir
Feb 16, 2011
Alex Folland
Feb 16, 2011
Jesse Phillips
February 16, 2011
Hello,

Which characters are to be escaped:
* inside [] classes
* outside such classes
?

Also, is there for D regexes a "free form" format (where whitespace can be used to present formats more legibly, but must be escaped as literals)?

Denis
-- 
_________________
vita es estrany
spir.wikidot.com

February 16, 2011
On 2011-02-16 5:48, spir wrote:
> Hello,
>
> Which characters are to be escaped:
> * inside [] classes
> * outside such classes
> ?
>
> Also, is there for D regexes a "free form" format (where whitespace can
> be used to present formats more legibly, but must be escaped as literals)?
>
> Denis


This is a comment in a regular expression: (?#comment)

The text, "comment", can be replaced with anything including whitespace.  The comment is terminated with ).

Oh, never mind.  I just tested this.  std.regex doesn't support regex comments, apparently.  :(
February 16, 2011
spir Wrote:

> Hello,
> 
> Which characters are to be escaped:
> * inside [] classes
> * outside such classes
> ?
> 
> Also, is there for D regexes a "free form" format (where whitespace can be used to present formats more legibly, but must be escaped as literals)?

Though you are probably asking specifically about D:

http://www.regular-expressions.info/charclass.html

std.regex doesn't follow everything so testing usually must be done with D. There is no place to find what isn't supported by D. Filing bugs is of course a good choice.