Skip to content

Instantly share code, notes, and snippets.

@plu
Created December 12, 2011 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plu/1466347 to your computer and use it in GitHub Desktop.
Save plu/1466347 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
my $TOKEN_RE = qr/
(?:
<(?<tag>
\s*
[^>\s]+
)>
)??
/xis;
"<html><body></body></html>" =~ m/$TOKEN_RE/gcs;
for ( 1 .. 1000000000 ) {
my $tag = $+{tag};
}
@nevesenin
Copy link

Hmmm... komische Sache das! Ist wohl ne Kombination aus named captures und den ? quantifiern. Wenn man die weg lässt, dann läufts auch mit den named captures.

@plu
Copy link
Author

plu commented Dec 13, 2011

@plu
Copy link
Author

plu commented Dec 13, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment