Results 1 to 2 of 2

Thread: Regular Expression

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    25

    Thumbs up

    Does anybody knows what the regular expresion pattern for a variable string (includes '_' but does not starts with '_' and does not include ?/#@!%^&* and spaces).

    Thanks

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    Private Sub Text1_KeyPress(KeyAscii As Integer)
    
    'allow only alpha and numerical and _ and no other keys
    If KeyAscii = 95 Or KeyAscii >= 65 And _
      KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 122 _
          Or KeyAscii >= 48 And KeyAscii <= 57 Then
        
             KeyAscii = KeyAscii
        Else
            KeyAscii = 0
    End If
        
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width