Main Contents

Random thought

November 11, 2008

What is the shortest regular expression that matches only itself, including the / delimiters?

Filed under: Programming | Comments (1)

1 Comment

  1. fanf.livejournal.com/ November 20, 2008 @ 13:15

    I think there isn’t one that matches *only* itself, because the only way a regex can match a string that is longer than itself is using a repeat operator, which implies the regex will match more than just itself.

Leave a comment

Login