Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 654691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:31:18+00:00 2026-05-13T22:31:18+00:00

In javascript I check for some characters but I want to allow underscores and

  • 0

In javascript I check for some characters but I want to allow underscores and slashes but I don’t know how.

    alias: /^[a-z-Z0-9]{2,35}$/

How to put / and _ so it has not special meaning to Regexes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:31:19+00:00Added an answer on May 13, 2026 at 10:31 pm

    _ has no special meaning at all in Regex.

    And if a character has special meaning, you can use \ to “despecialize” it.

    alias: /^[a-zA-Z0-9_\/]{2,35}/
    

    (BTW, you can use \w which means [a-zA-Z0-9_], i.e. /^[\w\/]{2,35}/. The \ in \w turns a normal character w to have a special meaning.)

    (Edit: Inside the […] the / will not be recognized as a delimiter so it is safe to use /^[\w/]{2,35}/. Thanks Andy E for showing this.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

if i want to match some thing with javascript i can use foo.match(); but
Can I use JavaScript to check (irrespective of scrollbars) if an HTML element has
I have a javascript function (function1) that checks some global variables (can the user
I would like to check my JavaScript files without going to JSLint web site.
How do I check if an object property in JavaScript is undefined?
I'd like to check if the user input is an email address in JavaScript,
Does anyone have a library or JavaScript snippet to validate the check digit of
I am doing some self learning about Patern Matching in Javascript. I got a
For some reason the viewstate of my application became gigantic (around 14 million characters).
I'm working on key handling in Javascript. I have done some research and I'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.