@gruber’s improved regex for matching URLs written in Ruby
There were some minor changes to make this a valid Ruby regexp. Thanks @gruber
Ruby regex performance
Just checking to see what the performance difference is between evaluating three separate regular expressions versus a single composite in ruby:
ryan = /\ARyan/
blake = /\ABlake/
darren = /\ADarren/
vs:
composite_regex = /\A(Ryan|Blake|Darren)/
The composite takes ~ 34% of the time as doing the three regex matches/evaluations. Nothing earth shattering here, was just wondering.