Friday, November 30, 2007

replace a whole word with different text

The following examples replaces the whole word unidad with lección in a po file.
perl -p -i.bak -e 's/\bunidad\b/lección/g' wwwroot/app/locale/es_mx/LC_MESSAGES/default.po

the /b is used to match a "word boundary"

No comments: