in reply to Re^2: User configurable regex
in thread User configurable regex

Why would your users have to type the double quotes?
#!/usr/bin/perl -w use strict; my $substitution = '$line =~ '.<DATA>; my $line = "abcdef"; eval $substitution; print $line; __DATA__ s/abc(\w+)f/xxx$1x/;
output:
xxxdex
Update: what I mean is; the problem you're describing only occurs in string literals (and it could already be a lot less annoying if you used single quotes). this interpolation does not occur in strings per se.

Replies are listed 'Best First'.
Re^4: User configurable regex
by MiggyMan (Sexton) on Oct 20, 2004 at 12:03 UTC
    You know i did try this earlier and im sure i did it right but to no avail however i've just done so again and it's working :)

    I'll go hide in the corner :)

    Just so you know the user would *never* type the regex out as such. they'll ultimatley be entering it via a gui interface and sending it off to a server to store in a config file, the regex is used in a print system i've been developing to re-format the usernames into more readable forms and it's used by the input filter :)