in reply to Re^4: How to match more than 32766 times in regex?
in thread How to match more than 32766 times in regex?
, but I decided to stay with zeroes and ones, and wrote () = $line =~ /(.)\1*/g (as I shown). Later I add to $len: /(.)\1\1|(.)\2.*(.)\3/ + /(.)\1/, because each regex if succedes it gives +1 to the possible length of subsequence after one inversion.$line =~ y/1/,/; $len = split /\b/, $line;
- it consumed too much time when solving input line '01' x 5e4;$len = + (() = /(.)\1*\1*\1*\1*/g) + /(.)\1\1|(.)\2.*.*.*.*(.)\3/ + /(.)\1/
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: How to match more than 32766 times in regex?
by Anonymous Monk on Dec 02, 2015 at 02:12 UTC | |
by Anonymous Monk on Dec 02, 2015 at 03:28 UTC | |
by Anonymous Monk on Dec 02, 2015 at 04:06 UTC | |
by Anonymous Monk on Dec 02, 2015 at 06:21 UTC | |
by rsFalse (Chaplain) on Dec 02, 2015 at 16:58 UTC | |
by Anonymous Monk on Dec 02, 2015 at 17:39 UTC |