Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 77 Pomógł: 0 Dołączył: 7.05.2002 Skąd: Sz-n/Wroc/Wawa Ostrzeżenie: (0%)
|
Kod $szablon = '<table width=400>
<tr> <td><font size=1 color=gray>||R1||</font> - <B>||strtoupper(R2)||</B></td> </tr> <tr> <td style="text-align: justify"><font face=verdana size=2><DD>||formatuj(R3)||</td> </tr> <tr> <td align=right><a href="mailto:||R5||">||R4||</a></td> </tr> </table>' napisalem sobie taki szablonik i chcialbym zeby sie wykonywal tzn. R* zamienial na odpowiednie zmienne (tu problemu nie ma), ale chcialbym zeby wykonywal tez odpowiednie funkcje np. ||strtoupper(R2)|| niech w to miejsce wstawi odpowiednia zmienna przetworzana przez funkcje 'strtoupper' probuje cos kombinowac ze eregi_replace i eval ale mi nie wychodzi. moze mi ktos pomoc |
|
|
|
![]() |
Post
#2
|
|
|
Grupa: Przyjaciele php.pl Postów: 2 335 Pomógł: 6 Dołączył: 7.03.2002 Ostrzeżenie: (0%)
|
Cytat I must've read 50 regular expression tutorials and understood nothing from each. I finally worked them out through playing around and looking at other people's examples. I wrote this to summarise and clarify things. I find it helps as a quick lookup reference:
^ Start of String $ End of string n* Zero or more of 'n' n+ One or more of 'n' n? A possible 'n' n{2} Exactly two of 'n' n{2,} At least 2 or more of 'n' n{2,4} From 2 to 4 of 'n' () Parenthesis to group expressions (n|a) Either 'n' or 'a' . Any single character [1-6] A number between 1 and 6 [c-h] A lower case character between c and h [D-M] An upper case character between D and M [^a-z] Absence of lower case a to z [_a-zA-Z] An underscore or any letter of the alphabet ^.{2}[a-z]{1,2}_?[0-9]*([1-6]|[a-f])[^1-9]{2}a+$ A string beginning with any two characters Followed by either 1 or 2 lower case alphabet letters Followed by an optional underscore Followed by zero or more digits Followed by either a number between 1 and 6 or a character between a and f (Lowercase) Followed by a two characters which are not digits between 1 and 9 Followed by one or more n characters at the end of a string jolyon at mways dot co dot uk 03-Feb-2002 09:43 The postcode example listed here isn't correct - it won't correctly detect Inner London postcodes (and others?) with an extra letter, eg: EC1M 3AA I've also ammended it so that the space is optional: if(eregi('^[A-Z]{1,2}[0-9]{1,2}[A-Z]? ?[0-9][A-Z]{2}$',$postcode) { print "You have a valid postcode!"; } Jak znajde wiecej to podesle. |
|
|
|
maggot szablonik 27.10.2002, 15:11:52
kurtz Re: szablonik 27.10.2002, 17:12:50
Seth Polecam gotowy skrypt wzorcow: smarty.php.net
P.S... 27.10.2002, 17:14:47
kurtz CytatPolecam gotowy skrypt wzorcow: smarty.php.net... 27.10.2002, 17:19:00
Seth Zabijajac muche bazuka masz pewnosc, ze zginela (m... 27.10.2002, 19:47:19
maggot Re: szablonik 27.10.2002, 19:50:46
kurtz Re: szablonik 27.10.2002, 21:05:17
kurtz CytatCytatI must've read 5...
a nie lepiej poswiec... 27.10.2002, 21:06:35
Seth Ten cytat znalazlem w komentarzach bodajze do funk... 27.10.2002, 22:27:07
maggot doszedlem do czegosc takiego:
Kodpreg_replace... 27.10.2002, 23:23:45
dragossani Zgadzam się z Seth'em w sprawie Smarty. Lepiej mie... 30.12.2002, 14:02:40 ![]() ![]() |
|
Aktualny czas: 26.12.2025 - 03:49 |