Regexps can be fast, but they don't have to

Ba17945a06aac247b06548d5afe341e8?s=47 mrzasa
March 17, 2018

Regexps can be fast, but they don't have to

LIghtning talk about regexp performance pitfalls in Ruby and browser. Wroclove.rb 2018

Ba17945a06aac247b06548d5afe341e8?s=128

mrzasa

March 17, 2018
Tweet

Transcript

  1. REGEXPS CAN BE REGEXPS CAN BE FAST FAST BUT THEY

    DON'T HAVE TO BUT THEY DON'T HAVE TO MACIEK RZĄSA, TEXTMASTER MACIEK RZĄSA, TEXTMASTER @mjrzasa
  2. None
  3. None
  4. BROWSER BROWSER <input id="operation" pattern='(\d+[+-]?)+='> https://regex-performance.github.io/input-en.html

  5. RUBY RUBY 1231_1231_21312_1231231_12312 /(\d+_?)+\b/

  6. 100% CPU ON PRODUCTION 100% CPU ON PRODUCTION Hello! →

    Witaj! → ¡Hola! → Salut ! Discourse client, described by Sam Saffron ::Typography.to_html_french # Insert a thin space before punctuation text.gsub(/(\s|)+([!?;]+(\s|\z))/, '&thinsp;\2\3') # <-58 spaces> GET /wp-login.php HTTP/1.1 69 GET /show.aspx HTTP/1.1 15
  7. DEBUGGER DEBUGGER http://regex101.com

  8. WHAT COULD I DO? WHAT COULD I DO?

  9. None
  10. JUST KIDDING JUST KIDDING

  11. WHAT COULD I DO? WHAT COULD I DO? be specific

    test almost matching input don't believe in magic, there is just software I will send links on twitter
  12. None