in reply to Re: Regexes and backslashes
in thread Regexes and backslashes

> If '\\n' (3 chars) is supposed to map to a single newline, what did you want '\n' to map to? '\n' (2 chars) or 'n'?

I don't want '\n' remapped at all. The only three things that I do want remapped are \, \; \\n - everything else should just be left as is.

> A hash isn't necessary if you use y///.

But I'm not trying to replace anything like a list of similar metacharacters. The whole challenge here is that I'm dealing with a set of things that are unlike each other: two sets of literal characters and one that is a literal plus a metacharacter. I'm just wondering if they can be handled by a common mechanism; that's what I'm asking about.

Thank you for trying.

-- 
Education is not the filling of a pail, but the lighting of a fire.
 -- W. B. Yeats

Replies are listed 'Best First'.
Re^3: Regexes and backslashes
by 7stud (Deacon) on Feb 17, 2011 at 03:56 UTC
    To get a two character literal '\n' to convert to a newline "\n", which is not two characters,I think you have to use eval().
      No, its already been demonstrated that you don't have to use eval.
Re^3: Regexes and backslashes
by 7stud (Deacon) on Feb 17, 2011 at 03:56 UTC
    To get a two character literal '\n' to convert to a newline "\n", which is not two characters, I think you have to use eval().