Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1103 (new enhancement)

Opened 6 months ago

Last modified 5 months ago

Regex - Support for \s and friends in character classes []

Reported by: darrylb Assigned to: jascha
Priority: major Milestone: 0.99.8
Component: Core Functionality Version: trunk
Keywords: Cc:

Description

Seems (to me, at least) to be a regular thing to do to put pre-defined items such as \s inside a character class, so that one can do things like [\s_]+, or [\s\w]+, etc. It doesn't seem to work in Tango's Regex though, as compared to PCRE:

Testing regex '(abc)([\s]+)([^\s+])'...
        (input string 'abc   qrstuv')
        PCRE::Regex
                0 : 'abc   q'
                1 : 'abc'
                2 : '   '
                3 : 'q'
        Tango.Regex
                (No Match)
Testing regex '([\s]+)(.*)'...
        (input string '   sssbbb')
        PCRE::Regex
                0 : '   sssbbb'
                1 : '   '
                2 : 'sssbbb'
        Tango.Regex
                0 : 'sssbbb'
                1 : 'sss'
                2 : 'bbb'

it would be fantastic if Tango's Regex could support this :)

Change History

07/02/08 17:33:30 changed by jascha

  • milestone changed from 0.99.7 to 0.99.8.