* Sergey Poznyakoff wrote on Sat, Jun 23, 2007 at 02:04:29PM CEST: > Ralf Wildenhues <[EMAIL PROTECTED]> ha escrit: > > > Can s/yy/.../ change anything unintended? E.g., do we need to ensure it > > only changes words beginning with yy? > > In theory it could, for example if the programmer used identifiers > beginning with, or containing `yy'. However, I can hardly imagine > someone who does that. At least, all yacc manuals declare that `yy' > prefix is reserved for yacc/lex identifiers and explicitly discourage > its use in application identifiers. > > It would be preferable, of course, to change only those `yy' that occur > at the beginning of words. But I cannot figure out a portable way of > doing so in sed.
Something like s/^yy/REPL/ s/\([^a-zA-Z0-9]\)yy/\1REPL/ but then sed should be executed as 'LC_ALL=C sed' to avoid locale issues. Another possibility is to just list all letters, as is done elsewhere in the script (and could be factored in shell variables, like Autoconf does. Cheers, Ralf