Read more

A regular expression that will never match

Arne Hartherz
February 20, 2013Software engineer at makandra GmbH

So you have a method returning a regular expression but one case that should not yield a matching Regexp object but still keep the API stable? Just return one that never matches:

/(?!)/
Illustration online protection

Rails professionals since 2007

Our laser focus on a single technology has made us a leader in this space. Need help?

  • We build a solid first version of your product
  • We train your development team
  • We rescue your project in trouble
Read more Show archive.org snapshot
Posted by Arne Hartherz to makandra dev (2013-02-20 19:15)