Created
April 26, 2014 08:21
-
-
Save kaz-utashiro/11314743 to your computer and use it in GitHub Desktop.
Perl の @- と @+ のペナルティが高すぎる ref: http://qiita.com/kaz-utashiro/items/2facc87ea9ba25e81cd9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (/pattern/g) { | |
my($s, $e) = ($-[0], $+[0]); | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (/(pattern)/g) { | |
my($s, $e) = (pos() - length($1), pos()); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment