--- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> Paul wrote:
> > --- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
>
> Why are you replying to me instead of the OP? :-)
lol -- oops.
Must've hit "Reply" instead of "Reply All". General apologies all
'round. :)
> > > How can y give s sbstition order
Paul wrote:
>
> --- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
Why are you replying to me instead of the OP? :-)
> > How can y give s sbstition order of the kind
> > @string=~s/nonalfanum//g;
>
> Assuming @string was intended to be an array of values to scrub
> otherwise, use $string.
>
>
Paul wrote:
>
> y/[A-Za-z0-9]/[A-Za-z0-9]/d for @string;
>
> This replaces alphas and digits with themselves, and deletes everything
> else; it does so for each item in @string iteratively.
>
hua?
david
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL P
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> How can y give s sbstition order of the kind
> @string=~s/nonalfanum//g;
Assuming @string was intended to be an array of values to scrub
otherwise, use $string.
> in these two cases?
> 1-wich will search and replace with "" (empty char) all nu
Andre wrote:
>
> Hi
Hello,
> How can y give s sbstition order of the kind
> @string=~s/nonalfanum//g;
^^
The =~ operator binds to scalars NOT arrays.
$string =~ s/[^[:alnum:]]+//g
> in these two cases?
> 1-wich will search and replace with "" (empty char) all nunnumeric or nonalphabet
Andre wrote:
> Hi
> How can y give s sbstition order of the kind
> @string=~s/nonalfanum//g;
> in these two cases?
> 1-wich will search and replace with "" (empty char) all nunnumeric or
> nonalphabetic chars?
s/[\W_]//g;
> 2-wich will search and replace with "" (empty char) all nunnumeric or
This is one way:
A) Save script.pl
use strict;
while(@ARGV){
my $text = shift;
$text =~ s/[^a-z0-9]//ig; # 1
# $text =~ s/[^a-z0-9_@.-]//ig;# 2
print "$text\n";
}
B) usage: script.pl am13-+km9 am13-+km9_@.-$#!%^&*()
1. comment out #2 above
2. comment out #1 above
"A
Hi
How can y give s sbstition order of the kind
@string=~s/nonalfanum//g;
in these two cases?
1-wich will search and replace with "" (empty char) all nunnumeric or nonalphabetic
chars?
2-wich will search and replace with "" (empty char) all nunnumeric or nonalphabetic
chars with the exception of