Everyday Regular Expressions

From UCLUG
Jump to: navigation, search

On December 10, 2013, Jas Eckard gave this talk on Everyday Regular Expressions:

  • what/why
    • wildcards/glob
    • search (replace)
    • "meta-language"
    • BRE, ERE, PCRE
  • components
    • literal characters
      • grep
    • metacharacters
      • . ← any character
    • begin/end of line
      • ^$
    • character classes
      • [dvlshjvkjdlsfhj]
      • ranges
        • [0-9a=zA-Z] ← notice fat-finger: a, =, and z not a thru z
        • include dash: [-0-9] or [a-j-]
      • complement
        • [^]
        • include caret: [x^]
        • exclude caret: [^x^]
    • quantifiers
      • color colour → colou?r
      • helllo hey hello → hel*
      • greedy/lazy
        • <html>stuff</html>
    • alternator
      • |
    • subexpressions/grouping
      • ay/bee/see/dee/ee/eff →  :s?\(.*\)/\(.*\)?\2/\1?
  • examples