in reply to Re: Need regex to check for disallowed characters
in thread Need regex to check for disallowed characters

i've tried /(\W)*(\d)*(\s){2,}/ but because of the \W it ignores the \s{2,}. What i need is something that will allow only one space.
  • Comment on Re: Re: Need regex to check for disallowed characters

Replies are listed 'Best First'.
Re: Re: Re: Need regex to check for disallowed characters
by blue_cowdawg (Monsignor) on Apr 09, 2004 at 19:49 UTC

        What i need is something that will allow only one space.

    From perldoc perlre:

               {n}    Match exactly n times 
               {n,}   Match at least n times
               {n,m}  Match at least n but not more than m times
     
    
    If you want to match exactly one space you could either use just \s or \s{1}.