[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] reg ex til validering af password - kan det gøres kortere?



On 12/12/06, Martin Møller Pedersen <sslug@sslug> wrote:
> pass =~ /\d/                  #mindst et tal
> pass =~ /\w/                  #mindst et bogstav

hvad med det modsatte i en linie:
pass =~ /[^\d]|[^\w]/  # ingen tal eller ingen bogstaver

Oventstående vil matche: b777777 (som er acceptabelt) (b er ikke et tal, 77777 er ikke bogstav). og: _77777 (som er uacceptabelt) (_ er ikke et tal, 77777 er ikke bogstav).


Jeg tror siemen valgte det korteste, som er både korrekt og effekt.

/Ole

 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-01-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *