in reply to Insert Space between names

s/\B(?=\p{Upper})/ /g;

Don’t use [A-Z], that’s a red flag. It only works for English, at most.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^2: Insert Space between names
by sauoq (Abbot) on Nov 21, 2005 at 15:12 UTC
    Don’t use [A-Z], that’s a red flag. It only works for English, at most.

    There is a lot of software that only works for Englsh; I'm not sure I'd call it a "red flag". Maybe more flexibility should be used in this case, and maybe it doesn't matter. Don't get me wrong... it's good advice. I just don't see a "red flag" when I see [A-Z] unless I know that the program needs to deal with character sets other than ASCII. That has been rare in my world (though decreasingly so.)

    -sauoq
    "My two cents aren't worth a dime.";
    

      Considering you don’t speak English, German and Greek, that doesn’t suprise me… :-)

      For me, it is the other way around: I use [A-Z] explicitly when I really mean to deal with ASCII only.

      Makeshifts last the longest.