regex

Table of Contents

1. regex

1.4. regex style

https://www.rexegg.com/regex-style.html
In a chain of regex substitutions, apply first more specific, concrete ones, and then the more general ones
The most general rules are only applied if there isn’t any match in the previous ones

1.5. Fake look-ahead/look-behind

:s/\v([^6])66([^6])/\169\2/g

7667 6666

1.6. Look-Ahead/Look-Behind

1.6.1. Demystifying Look-Ahead and Look-Behind in Regex

Regexes lookarounds explained simply
More links to advanced resources

1.7. dokuwiki

   .            Cualquier carácter
   [abc]        Cualquier carácter entre corchetes
   [^abc]       Cualquier carácter que no esté entre corchetes (pero no matchea ∅, tiene que haber algo)
   [^abc]?      Cualquier carácter que no esté entre corchetes, o ∅
   [abc|def]    O bien abc o bien def (??)
   ^            Comienzo de la linea/string
   $            Final de la linea/string
   ?            Carácter anterior cero o una vez
   +            Carácter anterior una o mas veces
   *            Carácter anterior cero o mas veces
   {m,n}        Carácter anterior entre m y n veces (m < n)
   \xhh         Carácter en hexadecimal
   inicio-fin   Caracteres desde inicio hasta fin
   (regex)      Define un grupo para que se use más adelante.
   \n           Grupo n-ésimo (búsqueda)
   $n           Grupo n-ésimo (remplazo)

Author: Julian Lopez Carballal

Created: 2024-09-16 Mon 04:41