Re: regexp issues TR

2001-07-29 Thread Rachel Coleman
> Let me rephrase what I want to do since I was so unclear the first > time: I want to output an error message every time the input > includes characters that are not the following: A-Za-z0-9_@.- or a > space(s). > At this point, I've tried: > > if ($params{$i} !~ /[^\w\@.-\s]/g) { > print "Erro

RE: regexp issues TR

2001-07-29 Thread Teresa Raymond
>Wags ;) > >-Original Message- >From: Teresa Raymond [mailto:[EMAIL PROTECTED]] >Sent: Saturday, July 28, 2001 08:59 >To: [EMAIL PROTECTED] >Subject: Re: regexp issues TR > > >Let me rephrase what I want to do since I was so unclear the first >time: I want t

RE: regexp issues TR

2001-07-28 Thread Abdulaziz Ghuloum
Hello, I believe you don't need the /g modifier in that regexp since a single match to an unwanted character is enough. Aziz,,, In article <[EMAIL PROTECTED]>, "Wagner-David" <[EMAIL PROTECTED]> wrote: > Here is some code which does what you want: > > #!perl -w > # A-Za-z0-9_@.- > > while (

RE: regexp issues TR

2001-07-28 Thread Wagner-David
[mailto:[EMAIL PROTECTED]] Sent: Saturday, July 28, 2001 08:59 To: [EMAIL PROTECTED] Subject: Re: regexp issues TR Let me rephrase what I want to do since I was so unclear the first time: I want to output an error message every time the input includes characters that are not the following: A-Z

Re: regexp issues TR

2001-07-28 Thread Teresa Raymond
Let me rephrase what I want to do since I was so unclear the first time: I want to output an error message every time the input includes characters that are not the following: A-Za-z0-9_@.- or a space(s). At this point, I've tried: if ($params{$i} !~ /[^\w\@.-\s]/g) { print "

Re: regexp issues TR

2001-07-26 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 25, Teresa Raymond said: >I tried the following code to test for bad characters but keep >getting my error msg though the values passed do not contain chars >that are not "A-Za-z0-9_@.-" (I also reread my last post and found >that my English articulation was very poor, I'm grateful that

Re: regexp issues TR

2001-07-25 Thread Teresa Raymond
I tried the following code to test for bad characters but keep getting my error msg though the values passed do not contain chars that are not "A-Za-z0-9_@.-" (I also reread my last post and found that my English articulation was very poor, I'm grateful that anyone responded!). #TEST FOR BAD

Re: regexp issues

2001-07-23 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 23, Teresa Raymond said: >How would you correct this expression to accept only alpha/numeric >except the @ and . (period) symbols? In other words, how would I add >multiple chars to exclude to the regex? Err, you mean "accept only alphanumerics AND @ and .". >if ($name=~/^W&&[^@]]+$/)

Re: regexp issues

2001-07-23 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 23, Michael Fowler said: >On Mon, Jul 23, 2001 at 04:53:28PM -0400, Jeff 'japhy/Marillion' Pinyan wrote: >> Hopefully, in Perl 5.8 or Perl 6, there will be a much simpler character >> class subtraction syntax: >> >> if ($name =~ /^[\w&&[^0-9_]]+$/) { >> # valid >> } > >I was under

Re: regexp issues

2001-07-23 Thread Teresa Raymond
How would you correct this expression to accept only alpha/numeric except the @ and . (period) symbols? In other words, how would I add multiple chars to exclude to the regex? if ($name=~/^W&&[^@]]+$/) { print "Only the @ and . characters are allowed"; } > if ($name =~ /^[\w&&[^0-9_]]

Re: regexp issues

2001-07-23 Thread Jos I. Boumans
This is most definately not the same... \w is equivalent to [A-Za-z0-9_] there's a basic regexp tutorial here: http://japh.nu/index.cgi?base=regexes it also deals with (custom made) character classes, special symbols in regexps etc, maybe it's beneficial to you. regards, Jos Boumans Also, [

Re: regexp issues

2001-07-23 Thread Michael Fowler
On Mon, Jul 23, 2001 at 04:53:28PM -0400, Jeff 'japhy/Marillion' Pinyan wrote: > Hopefully, in Perl 5.8 or Perl 6, there will be a much simpler character > class subtraction syntax: > > if ($name =~ /^[\w&&[^0-9_]]+$/) { > # valid > } > > which reads "\w AND NOT 0-9_". I was under the i

Re: regexp issues

2001-07-23 Thread Carl Rogers
Good day, Stephanie; At 01:46 PM 7/23/2001 -0700, Stephanie Stiavetti wrote: >I need to make sure that a field contains ONLY letters... and this is the >regular expression I'm using: > >$name=~/^[a-zA-Z]+/ > > >it doesn't seem to be working in the test script that I wrote: Your test script worke

Re: regexp issues

2001-07-23 Thread Paul
--- Stephanie Stiavetti <[EMAIL PROTECTED]> wrote: > I need to make sure that a field contains ONLY letters... and this is > the > regular expression I'm using: > > $name=~/^[a-zA-Z]+/ > what am I doing wrong? This guarantees that it *starts* with letters. Add a $: $name=~/^[a-zA-Z]+$/ Now i

RE: regexp issues

2001-07-23 Thread Mooney Christophe-CMOONEY1
The expression you're using will match letters at the beginning of a string, but will allow for other stuff at the end. To avoid this, put a $ at the end of your regex. Also, [a-zA-Z] can be replaced with \w, which does the same thing. So, you have $name =~ /^\w+$/ -Original Message-

Re: regexp issues

2001-07-23 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 23, Stephanie Stiavetti said: >I need to make sure that a field contains ONLY letters... and this is the >regular expression I'm using: > >$name=~/^[a-zA-Z]+/ That doesn't check to make sure the string ONLY has those. It checks to see whether it STARTS with them. >what am I doing wrong?