Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Dynamic data within regex pattern?
October 1, 2004, 5:53 pm
rate this thread
generated at runtime?
I.e., something along the lines of...
$output =~ s/$someVar/$someOtherVar/g;
I read in my Perl book that the replacement string is variable interpolated, but
it didn't say anything about that being the case for the regex pattern. So I
guess in the situation above, the regex would match the end of a line followed
by "someVar". And if you escaped the dollar sign, it would match "$someVar"
Any assistance would be greatly appreciated.
- Gunnar Hjalmarsson
October 2, 2004, 4:18 am
Re: Dynamic data within regex pattern?
What happened when you tried it?
You guessed wrong.
You don't need any assistance at this stage. You need to play with
Perl, and figure out what 'works' and what doesn't. And maybe read a
Come back here if you fail in solving a particular problem.