Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Perl

Idiom #83 Regex with character repetition

Declare the regular expression r matching the strings "http", "htttp", "httttp", etc.

my $r = qr/htt+p/;

qr is a quote-like operator.

However, in perl it's more common to use a regular expression directly, without holding it in a variable.
(def r #"htt+p")

New implementation...
< >
deleplace