Re: Correct handling of case in unicode and regexps

Discussion in 'Python' started by MRAB, Feb 23, 2013.

  1. MRAB

    MRAB Guest

    On 2013-02-23 15:30, Devin Jeanpierre wrote:
    > On Sat, Feb 23, 2013 at 10:26 AM, Devin Jeanpierre
    > <> wrote:
    >> However, regex has the same behavior.

    >
    > My apologies, I forgot to set the VERSION1 flag.
    >
    > Interesting. 'ss' matches 'ß', but 's+' does not.
    >
    > Is this desirable behavior?
    >

    Getting full case folding to work can be tricky. There's always going to
    be a limit to what's worth doing.

    There are also areas where it's not clear what the result should be.
    You've already mentioned matching 's' against 'ß' (fails) and matching
    'ss' against 'ß' (succeeds), but how about matching '(s)(s)' against 'ß'
    (fails)?

    For the record, Perl also says that 'ss' matches 'ß', but 's+' does not.
     
    MRAB, Feb 23, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Devin Jeanpierre
    Replies:
    1
    Views:
    104
    jmfauth
    Feb 24, 2013
  2. Vlastimil Brom
    Replies:
    0
    Views:
    71
    Vlastimil Brom
    Feb 23, 2013
  3. Devin Jeanpierre
    Replies:
    0
    Views:
    85
    Devin Jeanpierre
    Feb 23, 2013
  4. Devin Jeanpierre
    Replies:
    0
    Views:
    68
    Devin Jeanpierre
    Feb 23, 2013
  5. Devin Jeanpierre
    Replies:
    0
    Views:
    74
    Devin Jeanpierre
    Feb 23, 2013
Loading...

Share This Page