Re: [PHP] VB-->PHP

2004-07-29 Thread Ni Shurong
I am familiar with pcre more then php's POSIX extension :) and it is said that preg_match() is faster than ereg(), see php manual for more info :) function isValid($strData, $bIncludeAlpha=false, $bIncludeNumber=false) { switch(true) { case $bIncludeAlpha && !$bIncludeNumber:

Re: [PHP] VB-->PHP

2004-07-29 Thread Jay
Ni Shurong wrote: I did not test it:) function isValid($strData, $bIncludeAlpha=false, $bIncludeNumber=false) { switch(true) { case $bIncludeAlpha && !$bIncludeNumber: $ptr = "/^[a-zA-Z]+/"; break; case !$bIncludeAlpha && $bIncludeNumber: $ptr

Re: [PHP] VB-->PHP

2004-07-29 Thread Jay
Jason Wong wrote: On Thursday 29 July 2004 17:00, Jay wrote: Can someone pelase help me to convert the following Vbscript code to PHP, i am really sucky at Regular Expression: Why don't you state your problem in English so that even those people not familiar with VB will understand and thus may

RE: [PHP] VB-->PHP

2004-07-29 Thread Ford, Mike [LSS]
On 29 July 2004 10:00, Jay wrote: > Hi! > > Can someone pelase help me to convert the following Vbscript code to > PHP, i am really sucky at Regular Expression: > -CODE VBSCRIPT- > Function IsValid(strData,blIncludeAlpha,blIncludeNumeric) > Dim regEx, retVal,strPtrn >

Re: [PHP] VB-->PHP

2004-07-29 Thread Ni Shurong
I did not test it:) function isValid($strData, $bIncludeAlpha=false, $bIncludeNumber=false) { switch(true) { case $bIncludeAlpha && !$bIncludeNumber: $ptr = "/^[a-zA-Z]+/"; break; case !$bIncludeAlpha && $bIncludeNumber: $ptr = "/^[0-9]+/";

Re: [PHP] VB-->PHP

2004-07-29 Thread Jason Wong
On Thursday 29 July 2004 17:00, Jay wrote: > Can someone pelase help me to convert the following Vbscript code to > PHP, i am really sucky at Regular Expression: Why don't you state your problem in English so that even those people not familiar with VB will understand and thus may be able to hel

[PHP] VB-->PHP

2004-07-29 Thread Jay
Hi! Can someone pelase help me to convert the following Vbscript code to PHP, i am really sucky at Regular Expression: -CODE VBSCRIPT- Function IsValid(strData,blIncludeAlpha,blIncludeNumeric) Dim regEx, retVal,strPtrn Set regEx = New RegExp If blIncludeAlpha Then strPt