parent nodes: EmacsApuntes

Expresiones regulares

Usad el constructor de expresiones regulares M-x regexp-builder La contrabarra nunca se usa sola siempre en combinación con otros caracteres, por ejemplo, si se usa con el punto deja de ser un caracter especial de regexp y se convierte en un carácter literal

Reemplazar cadenas usando expresiones regulares

Regexp Replacement

The M-x replace-string command replaces exact matches for a single string. The similar command M-x replace-regexp replaces any match for a specified pattern.

In replace-regexp, the newstring need not be constant: it can refer to all or part of what is matched by the regexp. M-x replace-regexp RET c[ad]+r RET \&-safe RET

replaces (for example) `cadr' with `cadr-safe' and `cddr' with `cddr-safe'.

M-x replace-regexp RET (c[ad]+r)-safe RET 1 RET

performs the inverse transformation.


Enlaces de interés

http://www.emacswiki.org/emacs/ReplaceRegexp
http://www.emacswiki.org/emacs/RegularExpressionHelp
http://es.wikipedia.org/wiki/Expresiones_regulares


[camelCaseWordsEnabled: false]