http://www.perlmonks.org?node_id=251318


in reply to New to RegEx... need translation

Now for the "real" fun... porting it to vbscript to run in ASP... I wish I could run this website my way instead of having to run it "their" way... thanks for the assists.
_____________________________________________________
mojobozo
word (wûrd)
interj. Slang. Used to express approval or an affirmative response to
something. Sometimes used with up. Source

Replies are listed 'Best First'.
Re^2: New to RegEx... need translation
by LAI (Hermit) on Apr 17, 2003 at 20:11 UTC

    Hissss! bad, bad nassty VBsssscript! We hates you, we does!

    LAI

    __END__
Re: Re: New to RegEx... need translation
by Jenda (Abbot) on Apr 17, 2003 at 20:32 UTC

    VBScript does have a regexp object. It's pretty weak, but it should be enough for this (not using my one-regexp solutions though ;-)

    This is how it could be in VB. VBScript will be almost the same. I'll black this out so that the innocent Perl guys are not affected:
    Private Function IsWeak(str As String) As Boolean Dim re As VBScript_RegExp_55.RegExp Set re = New VBScript_RegExp_55.RegExp IsWeak = True re.Pattern = "[a-z]" If Not re.Test(str) Then Exit Function re.Pattern = "[A-Z]" If Not re.Test(str) Then Exit Function re.Pattern = "[0-9]" If Not re.Test(str) Then Exit Function re.Pattern = "[;,.#!\$]" If Not re.Test(str) Then Exit Function IsWeak = False End Function
    Bleargh ......o...o.oo......oo.....oo...oooo..o..o.......

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature

      NO!

      NO! Take it away! It burns ussss! Oh, How it burnssss!

      Okay, I'll stop now :o)

      LAI

      __END__