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 8672151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:07:49+00:00 2026-06-12T19:07:49+00:00

I want a regex that has a string (a-z, A-Z, 0-9, can include ‘\’,

  • 0

I want a regex that has a string (a-z, A-Z, 0-9, can include '\', '/' and white sapces)

I tried it like this:

if (/[\s\\\/A-Za-z0-9]$/.test(Yourval)), 

but it doesn’t work well, can somebody help me? thanks!

  • 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-06-12T19:07:50+00:00Added an answer on June 12, 2026 at 7:07 pm

    This should work:

    if (/^[a-zA-Z0-9\s\\\/]+$/.test('Something with / and \\ 0 9')) { 
      alert('Good news everyone!'); 
    }
    

    … as you need two anchors here (both for the start and the end of the string), and + quantifier to test for more than a single character. In fact, this can be rewritten just as…

    if (/[^a-zA-Z0-9\s\\\/]/.test('Something with / and \\ 0 9')) { 
      alert('Crazy gibberish!'); 
    }
    

    … so we test for bad characters instead of trying to cover the string with only good ones. )

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

Sidebar

Related Questions

I want to use regex to split some string like this @key='value' to key
I have string like this /c SomeText\MoreText Some Text\More Text\Lol SomeText I want to
I'm using a regex to validate formulas (excel-like). Those formulas can contain string (between
I try build a php regex that validate this type of input string: {name:'something
I need a regex that matches the following (the brackets indicate I want to
I need a regex that will match blahfooblah but not blahfoobarblah I want it
In my regex, I want to say that within the sample text, any characters
I want to create a regexp that matches exactly the string foo , even
I want a regex pattern to find all the words of this format [xyzblab23la].
Heres my regex pattern: [A-Z][a-z]?-?([A-Z][a-z]?)? I want this regex to match the following: A

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.