Summary: std.regex does not support character sets other than
           Product: D
           Version: 2.041
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Lionello Lunesu <> 2010-05-29 
07:46:59 PDT ---
Created an attachment (id=647)
Patch against phobos/std/regex.d in

I'm writing an application that works with Chinese text encoded in GBK, . I could convert all the text to UTF8 first,
before using regex, but it's much faster to leave the text as-is and only
convert the regular expression to GBK instead. 

I suspect the following opcode need patching:
1. REanychar uses std.utf.stride;
2. REdchar and REidchar are used when the character in the regex >= 0x80;
3. REichar and REidchar use std.ctype.toupper (during creation and execution)

Point 1 and 3 are easily solved by providing the user with callback functions.
To prevent unnecessary indirection, these can be aliases if
(is(__traits(compiles, std.utf.stride(new E[], 0)))).d

Attached a proof of concept patch for point 1. If this is OK, I can do the same
for point 2 and 3 as well. (Point 2 might not even need a patch; not clear
about that now.)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to