| |
|
|
- Page 1 - |
|
Michael W. | somehow be I with the Umdefinieren the Ersatzzeichens into regulären squeeze out not so happy.
it would beautiful if The expressions so written go could, How everywhere differently too...
get this not to that walk... CompileMarkSeparation' maskierte Werte testen
Proc IsOk
Parameters x%
Return if(x%,"OK","nicht OK")
EndProc
Proc IsMask1'Datum
' erlaube nur "dd.mm.yyyy" (als Trenner aber "-","/",".")
' ungültiges Datum (z.B. 31.02.1999) wird nicht erkannt
Parameters TestWert$
var re$ = "([1-9]|[ 0][1-9]|[12][0-9]|3[01])[-/.](0[1-9]|1[012])[-/.](18|19|20|21)[0-9]{2}"
Return if(match$(re$,TestWert$),1,0)
EndProc
Proc IsMask2'email
' EMail nach RFC 2822 (mit einigen speziellen TLDs)
' zum Testen auch eine super simple....
Parameters TestWert$
/*
'ori: [a-z0-9!#$%&'*+/=?^_'{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_'{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|asia|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel)\b
var re$ = "(?i)[a-z0-9!#$%&'*+/=?^_'{|}~~-]+(~.[a-z0-9!#$%&'*+/=?^_'{|}~~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?~.)+([A-Z]{2}|asia|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel)~b"
*/
'TEST
'ori: \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b
var re$ = "(?i)~b[A-Z0-9._%+-]+@[A-Z0-9.-]+~.[A-Z]{2,6}~b"
'TEST
Return if(match$(re$,TestWert$),1,0)
EndProc
cls
print "Masken testen\n"
Declare Test$
Print "Datum"
Test$ = "1.12.1999"
Print Test$;tab(15);IsOk(IsMask1(Test$))
Test$ = "25-12-2007"
Print Test$;tab(15);IsOk(IsMask1(Test$))
Test$ = "12-25-2007"
Print Test$;tab(15);IsOk(IsMask1(Test$))
Test$ = "/12/1999"
Print Test$;tab(15);IsOk(IsMask1(Test$))
Print "\nEMail"
Test$ = "john@aol...com"
Print Test$
Case IsMask2(Test$) : Print " ";$Match
Print " ";IsOk(IsMask2(Test$))
Test$ = "Mike\\ O'Dell@ireland.com"
Print Test$
Case IsMask2(Test$) : Print " ";$Match
Print " ";IsOk(IsMask2(Test$))
Test$ = "The email address president@whitehouse.gov is valid."
Print Test$
Case IsMask2(Test$) : Print " ";$Match
Print " ";IsOk(IsMask2(Test$))
waitinput
href='./../../Function-References/XProfan/end/'>end
|
|
|
| XProfan X3System: Windows 8/10, XProfan X4 Programmieren, das spannendste Detektivspiel der Welt. | 12/16/14 ▲ |
|
|
|
|
« this Posting watts as Solution marked. » |
|
Michael W. | i'm of course still over the Ersatzzeichen unhappy, but the "simple" Error is enttarnt... CompileMarkSeparation' maskierte Werte testen
' (lauffähig)
Proc IsOk
Parameters x%
Return if(x%,"OK","nicht OK")
EndProc
Proc IsMask1'Datum
' erlaube nur "dd.mm.yyyy" (als Trenner aber "-","/",".")
' ungültiges Datum (z.B. 31.02.1999) wird nicht erkannt
Parameters TestWert$
var re$ = "([1-9]|[ 0][1-9]|[12][0-9]|3[01])[-/.](0[1-9]|1[012])[-/.](18|19|20|21)[0-9]{2}"
Return if(match$(re$,TestWert$)<>"",1,0)
EndProc
Proc IsMask2'email
' EMail super simple....
Parameters TestWert$
'ori: \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b
var re$ = "(?i)~b[A-Z0-9._%+-]+@[A-Z0-9.-]+~.[A-Z]{2,6}~b"
Return if(match$(re$,TestWert$)<>"",1,0)
EndProc
Proc IsMask3'email
' EMail nach RFC 2822 (mit einigen speziellen TLDs)
Parameters TestWert$
'ori: [a-z0-9!#$%&'*+/=?^_'{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_'{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|asia|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel)\b
var re$ = "(?i)[a-z0-9!#$%&'*+/=?^_'{|}~~-]+(~.[a-z0-9!#$%&'*+/=?^_'{|}~~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?~.)+([A-Z]{2}|asia|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel)~b"
Return if(match$(re$,TestWert$)<>"",1,0)
EndProc
cls
print "Masken testen\n"
Declare Test$
Print "Datum"
Test$ = "1.12.1999"
Print Test$;tab(15);IsOk(IsMask1(Test$))
Test$ = "25-12-2007"
Print Test$;tab(15);IsOk(IsMask1(Test$))
Test$ = "12-25-2007"
Print Test$;tab(15);IsOk(IsMask1(Test$))
Test$ = "/12/1999"
Print Test$;tab(15);IsOk(IsMask1(Test$))
Print "\nEMail simpel"
Test$ = "john@aol...com"
Print Test$
Case IsMask2(Test$) : Print " ";$Match
Print " ";IsOk(IsMask2(Test$))
Test$ = "Mike\\ O'Dell@ireland.com"
Print Test$
Case IsMask2(Test$) : Print " ";$Match
Print " ";IsOk(IsMask2(Test$))
Test$ = "The email address president@whitehouse.gov is valid."
Print Test$
Case IsMask2(Test$) : Print " ";$Match
Print " ";IsOk(IsMask2(Test$))
Print "\nEMail RFC 2822"
Test$ = "john@aol...com"
Print Test$
Case IsMask3(Test$) : Print " ";$Match
Print " ";IsOk(IsMask3(Test$))
Test$ = "Mike\\ O'Dell@ireland.com"
Print Test$
Case IsMask3(Test$) : Print " ";$Match
Print " ";IsOk(IsMask3(Test$))
Test$ = "The email address president@whitehouse.gov is valid."
Print Test$
Case IsMask3(Test$) : Print " ";$Match
Print " ";IsOk(IsMask3(Test$))
wa t
end
|
|
|
| XProfan X3System: Windows 8/10, XProfan X4 Programmieren, das spannendste Detektivspiel der Welt. | 12/16/14 ▲ |
|
|
|
|