Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Executing CGI/web form directives in regex substitution without pages of code

by Polyglot (Pilgrim)
on Feb 19, 2020 at 21:12 UTC ( #11113185=note: print w/replies, xml ) Need Help??


in reply to Re: Executing CGI/web form directives in regex substitution without pages of code
in thread Executing CGI/web form directives in regex substitution without pages of code

qr// does not appear to be designed to encapsulate the entire regex substitution expression, only the portion of it that would ordinarily be contained in the match section. I need something that will allow the substitution to be flagged for case-insensitive matching via the //i operator, in addition to the other portions (match / substitute) of the operation coming from user input (variable).

For example, trying this did not work for me:

$substitution = qr/s~$sv$ch$ww$regexM$ww$ch$ev~$regexR~g$regexI/; $line =~ $substitution;

Blessings,

~Polyglot~

  • Comment on Re^2: Executing CGI/web form directives in regex substitution without pages of code
  • Download Code

Replies are listed 'Best First'.
Re^3: Executing CGI/web form directives in regex substitution without pages of code
by haj (Chaplain) on Feb 19, 2020 at 22:01 UTC
    I guess here you miss the possibility to have modifiers within the regular expression? A postponed /i modifier can also be written as (?i) within the regex - and in this fashion used in qr//.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11113185]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2020-04-05 01:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (33 votes). Check out past polls.

    Notices?