I want to use a regular expression to do the following:
$text =~ s/abc([.\s]+)abc/cba$1cba/g;
Essentially, I want to replace: abc(some text)abc
with: cba(some text)cba
So, I'm trying to use ([.\s]+) to move the (some text) into the substitution area with the standard $1.
However, this regex doesn't capture parentheses, or any other kind of puctuation. Is there a regex that is a "catch all" for alphanumerics, spaces, AND punctuations? ([.\s]+) obviously doensn't work.
Thanks,
Bryan
$text =~ s/abc([.\s]+)abc/cba$1cba/g;
Essentially, I want to replace: abc(some text)abc
with: cba(some text)cba
So, I'm trying to use ([.\s]+) to move the (some text) into the substitution area with the standard $1.
However, this regex doesn't capture parentheses, or any other kind of puctuation. Is there a regex that is a "catch all" for alphanumerics, spaces, AND punctuations? ([.\s]+) obviously doensn't work.
Thanks,
Bryan