Hi, I think you should escape that period and dash as well.'^[a-zA-Z0-9-_. \[\]]+$''^[a-zA-Z0-9\-_\. \[\]]+$'or may be simpler:'^[\w\d_\-\. \[\]]+$'
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://list
Scott Purcell wrote, on Thursday, March 23, 2006 3:05
PM
: '^[a-zA-Z0-9-_.
]+$'
The others helped you get [] in
there. But hyphen (dash) has to be first, or it looks like a range operator. So
try:
^[-a-zA-Z0-9_.
\[\]]+$
Good
luck,
Joe
___
-Original Message-From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]On Behalf Of
Scott PurcellSent: Thursday, March 23, 2006 12:05To:
Perl-Win32-Users@listserv.ActiveState.comSubject: Reg _expression_
Help
Hello,
I have a regular _expression_ in
which I a
Scott wrote:
How can I incorporate the possibility of having a [ or ] in the user
input?
/^[a-zA-Z0-9-_. \[\]]+$/
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysub
Hello,
I have a regular _expression_ in which I am ensuring the user
enters some valid characters for our system.
Currently the _expression_ is so:
'^[a-zA-Z0-9-_. ]+$'
Meaning, a user can enter a-z or A-Z or 0-9, dashes,
underbars or periods and space.
I have a problem now, bec
TECTED] On Behalf Of
Scott Purcell
Sent: Thursday, March 23, 2006 14:05
To: Perl-Win32-Users@listserv.ActiveState.com
Subject: Reg Expression Help
Hello,
I have a regular expression in which I am ensuring the user
enters some valid characte
-Original Message-
> Can someone help me with the syntax of deleting the last word of text
string.
> i.e. $string = 'my abc 123'
> Like to have only 'my abc'
David,
Quick and easy:
$string = 'my abc 123';
$string =~ s/\s+\S+$//;
This assumes that you are replacing one or more whitespac
Hello David,
Wednesday, February 16, 2005, 5:26:22 PM, Вы написали:
HD> Hi,
HD> Can someone help me with the syntax of deleting the last word of text
HD> string.
HD> i.e. $string = 'my abc 123'
HD> Like to have only 'my abc'
use strict;
my $string = 'my abc 123';
$_ = $string;
my @string = spl
Hsu, David [HD], on Wednesday, February 16, 2005 at 10:26 (-0500)
thoughtfully wrote the following:
HD> Can someone help me with the syntax of deleting the last word of text
HD> string.
HD> i.e. $string = 'my abc 123'
HD> Like to have only 'my abc'
my $string = 'my abc 123 f ';
$string =~ s/(.*)\
han the array
slice. Lucky for me, since I would normally use the regex!
> -Original Message-
> From: Hsu, David [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 16, 2005 10:26 AM
> To: perl-win32-users
> Subject: Reg. expression help
>
>
> Hi,
> Can
On Wed, 16 Feb 2005, Erich Beyrent wrote:
> > Can someone help me with the syntax of deleting the last word of text
> string.
> > i.e. $string = 'my abc 123'
> > Like to have only 'my abc'
>
> #!/usr/bin/perl
>
> $string = 'some string';
> $string =~ s/(?<=\s)(.*?)$//g;
>
> print "String = $st
Hsu, David would like to recall the message, "Reg. expression help".
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> Hi,
> Can someone help me with the syntax of deleting the last word of text
string.
> i.e. $string = 'my abc 123'
> Like to have only 'my abc'
>
> Thanks,
> David
#!/usr/bin/perl
$string = 'some string';
$string =~ s/(?<=\s)(.*?)$//g;
print "String = $string\n";
HTH
-Erich-
_
Hi,
Can someone help me with the syntax of deleting the last word of text
string.
i.e. $string = 'my abc 123'
Like to have only 'my abc'
Thanks,
David
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://l
14 matches
Mail list logo