----- Original Message ----- From: "Bryan R Harris" <[email protected]>
Subject: \1 in character class?




I'm trying to temporarily deal with simple quoted strings by turning:

 data: "this is a string" more: "this is another"

into...

 data: "this&nbsp;is&nbsp;a&nbsp;string" more: "this&nbsp;is&nbsp;another"

TIA.

- Bryan



Here is a way using tbe module Regexp::Common.

#!/usr/bin/perl
use strict;
use warnings;
use Regexp::Common;

while (<DATA>) {
s/($RE{quoted})/ (my $s=$1) =~ s[\s][&nbsp;]g; $s/egx;
print;
}

__DATA__
data: "this is a string" more: "this is another"



--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to