in reply to Re^6: Reusing a complex regexp in multiple spots, escaping the regexp
in thread Reusing a complex regexp in multiple spots, escaping the regexp
Are they stored as nested objects causing overhead? (Hmm probably... I read something in the docs about them acting like closures.)
But what if I stringify/flatten the outcome and recompile it, even with a /o once modifier? This should reset most effects.
Unless context switches like different nested modifiers like /i cause new overhead...(?)
DB<1> p qr/[0-9a-f]/i (?^ui:[0-9a-f]) DB<2> $x=qr/[0-9a-f]/i DB<3> $hex_range= qr/$x+ - $x+/x DB<4> say $hex_range (?^ux:(?^ui:[0-9a-f])+ - (?^ui:[0-9a-f])+) DB<5>
I'll put this on my to-do list, and will try to dive deeper next weekend.
Like running benchmarks and looking into the op-tree.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Reusing a complex regexp in multiple spots, escaping the regexp
by tobyink (Canon) on Apr 16, 2026 at 13:00 UTC | |
by LanX (Saint) on Apr 16, 2026 at 14:39 UTC | |
by tobyink (Canon) on Apr 16, 2026 at 15:05 UTC | |
by LanX (Saint) on Apr 16, 2026 at 17:01 UTC | |
by tobyink (Canon) on Apr 17, 2026 at 08:15 UTC | |
|