Results 1 to 3 of 3

Thread: Javascript Regular Expression

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    9

    Arrow Javascript Regular Expression

    Hey all. I'm having some trouble with a regular expression.

    I'm trying to allow lbackspaces, lowercase letters, numbers, and dashes.

    Here it is:
    Code:
     var AllowRegex  = /^[\ba-z0-9-]$/;
    I'm testing it as such:
    Code:
    AllowRegex.test(character)
    For some reason it's not working. It only functions when I use it like this (which isn't the way I want it) : var AllowRegex = /^[\ba-zA-Z0-9-]$/;


    Can someone help me get to where I need to be?

    Thanks in advance!

    Mike.
    Last edited by mjclark91; Aug 22nd, 2012 at 12:21 PM.

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