in reply to My First LinkedIn Article On Perl
Hello pritesh_ugrankar. From your article:
The qr function allows for the regex to be stored in a variable so one can simply mention s/$regex_1/$regex_2/ instead of typing out the regex between the / and /.
The second part of the substitution operator ($regex_2 in your example) is a string, not a regular expression.
And therefore:
2) By saying s/$regex2/$regex1/ one can simply reverse the replacement done earlier if the need ever presents itself.
That will probably not work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: My First LinkedIn Article On Perl
by pritesh_ugrankar (Monk) on Jan 02, 2021 at 11:07 UTC |