[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] PHP5 og RegExp problem



On Sun, 19 Aug 2007, Nis wrote:

Skal i forbindelse med oprettelse/rettelse af nogle felter, teste indhold
mod flere regexp's.
Grundet brug af flere af de samme regexp's på flere felter/værdier, er alle
regexp's samlet i et array med flere levels.
På den måde, testes alle værdier mod et sæt af regexp's enkeltvis.

Problemet er, at jeg på flere felter, skal test om en string er eks. enten
helt tom eller mellem 10,650 tegn.
Da jeg ikke kan teste det enkeltvis, er det nødtil at være et samlet regexp.
Ellers vil det af dem der kommer først og ikke matcher, tælle som en fejl!

Jeg har forsøgt med flere forskellig regexps', men uden held:
(?:^[\w\W]{10,650}$|^$)
^[\w\W]{10,650}|![\w\W]{1,9}$

Det ser noget forkert ud.

Hvad med denne her:
preg_match( "/^(|.{10,650})$/" , $data );

Prøv fx. kregexpeditor, et rigtigt sjovt program. Eksempel på dato-match
http://www.sslug.dk/~chlor/kregexpeditor/

/hans
--
Horsebakken 78, DK-2400 København NV, Phone: +45 2264 8020
-------------------------------------------------------------
The key, the whole key, and nothing but the key,
so help me Codd.


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-09-01, 02:01 CEST [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] *