in reply to How can I force a regex to interpolate a substituted block?

> Is there a regex flag? an "eval" somehow?

yes /e and /ee and it's documented as "eval" (sic) feature

See the fine manuals for more

Or try searching for Perl regex eval

See also discussions regarding injections and security here regex eval site:perlmonks.org

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: How can I force a regex to interpolate a substituted block?
by misterperl (Friar) on Sep 17, 2024 at 14:55 UTC
    Rolf ++ vote for you as always- I'm on it! I'm starting to mistrust Gemini?
        WTF is Gemini?

        Maybe Project Gemini? At least that's the one I am familiar with in the context of ICT.

        It's google's current LLM chat interface.
Re^2: How can I force a regex to interpolate a substituted block?
by misterperl (Friar) on Sep 17, 2024 at 15:14 UTC
    Rolf /ee works TY!I had to add " inside the 'block' but works great!

    google gemini AI ? She's supposed to be smart but not nearly as smart as you!

Re^2: How can I force a regex to interpolate a substituted block?
by misterperl (Friar) on Sep 17, 2024 at 16:54 UTC
    Rolf I realize there are regex resources. But just citing them all doesn't mean any, or all describe "ee", for example:
    Metacharacters Modifiers Overview Details on some modifiers /x and /xx Character set modifiers /l /u /d /a (and /aa) Which character set modifier is in effect? Character set modifier behavior prior to Perl 5.14
    Not knowing that "ee" even exists , and it not being in this doc's modifier list, well, is less than useful? I agree if I studied maybe 12 regex guides I might eventually get to "ee" but that would be like Christmas by then. I tossed my Camel book having read it cover to cover in the 2000s but I don't recall ee in there either.. But it was a long time ago..

    Suggesting a bot that answers every question on every Perl forum with "read the docs"? But some questions are so obscure (like this) that if answered at all, its buried. I've successfully programmed in Perl since 1995 never knowing about or needing "ee" for example..

    Sometimes YOU are a much better resource than a mountain of docs.