Results 1 to 2 of 2

Thread: Regex Pattern Question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188

    Regex Pattern Question

    I am tryin to confirm a one word string (nickname) when users sign into my server. the allowed characters should be a-z 0-9 - ^ ~ ` [ ] _ { and }

    The pattern I have right now is

    (?i:^[a-z0-9_]+\w$)

    which works find for alphanumeric with underscores but if I cant figure out how to have it check for the other characters as well i thought adding them into the [] brackets as escape characters would do it but its not working

    can anyone help me out here?
    Last edited by Tewl; Aug 23rd, 2003 at 12:11 AM.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Actually this SHOULD work.
    (?i:^[a-z0-9_\-^~'[\]{}]+\w$)

    At least I'm quite sure that it would work in JavaScript.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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