Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Language of Regular Expressions. So You Think You Can Speak It? by Rustam Mehmandarov

Riga Dev Day
March 13, 2016
57

The Language of Regular Expressions. So You Think You Can Speak It? by Rustam Mehmandarov

Riga Dev Day

March 13, 2016
Tweet

Transcript

  1. The Language of Regular Expressions. So You Think You Can

    Speak It? Rustam Mehmandarov Riga Dev Day
  2. Recap: Lookaround (?=foo) -> Lookahead (?<=foo) -> Lookbehind (?!foo) ->

    Negative Lookahead (?<!foo) -> Negative Lookbehind
  3. Final Recap • Know your data! – Think what you

    should match – Think what you should not match • Know your flavor • Know your engine (DFA, NFA) – Backtracking • Greediness • Non-capturing parenthesis • Anchors
  4. Matching an IP - 4 Idea 4: ^ ([01]?\d\d?|2[0-4]\d|25[0-5])\. ([01]?\d\d?|2[0-4]\d|25[0-5])\.

    ([01]?\d\d?|2[0-4]\d|25[0-5])\. ([01]?\d\d?|2[0-4]\d|25[0-5]) $ Result: