rsFalse has asked for the wisdom of the Perl Monks concerning the following question:
where triple points means sequence of some symbols.b *aaaaa... 1 ...aaaaa...
#!/usr/bin/perl use warnings; use strict; $\ = $/; my $dict = 'b'; $_ = '*' . 'a' x (9e4 - 1e4) . "\n"; s/\?/[$dict]/g; s/\*/[^$dict]*/; my $qr = qr/^$_$/; print $_ =~ $qr ? "YES" : "NO" for 'a' x (0 + 1e4) . 'a' x (9e4 - +1e4) . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: the case where regex seems to work slower
by Corion (Patriarch) on Jul 26, 2017 at 09:32 UTC | |
|
Re: the case where regex seems to work slower
by choroba (Cardinal) on Jul 26, 2017 at 11:28 UTC | |
|
Re: the case where regex seems to work slower
by tybalt89 (Monsignor) on Jul 26, 2017 at 23:03 UTC | |
by rsFalse (Chaplain) on Jul 27, 2017 at 10:53 UTC | |
by tybalt89 (Monsignor) on Jul 27, 2017 at 11:40 UTC | |
by rsFalse (Chaplain) on Jul 27, 2017 at 12:57 UTC | |
by tybalt89 (Monsignor) on Jul 27, 2017 at 13:37 UTC | |
|
Re: the case where regex seems to work slower
by Anonymous Monk on Jul 26, 2017 at 13:02 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |