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

  • SEARCH
  • Home
  • 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 9004949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:01:10+00:00 2026-06-16T01:01:10+00:00

I have a javascript regex Value.match(/[A-Za-z0-9\-\,\.\(\)/]/) This gives me 1 if a string contains

  • 0

I have a javascript regex

   Value.match(/[A-Za-z0-9\-\,\.\(\)/]/)

This gives me 1 if a string contains alphabets, numbers, hyphen, comma, dot or braces; if any other character is found it gives 0.

When I apply same regex in PHP it is not working. Why?

  • 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-16T01:01:11+00:00Added an answer on June 16, 2026 at 1:01 am

    You don’t need to escape characters inside [] so you can try this /[A-Za-z0-9,.()]/ or even this one /[\w,.()]/ but if you want to check that the string contains only those characters that regex won’t do, try:

    /^[\w,.()]+$/
    

    I noticed that you also have /. Is that intentional or a mistake, because you don’t mention it in the question…

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

Sidebar

Related Questions

If I have a String in JavaScript key=value How do I make a RegEx
This is JavaScript regex. regex = /(http:\/\/[^\s]*)/g; text = I have http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd and I
I'm totally beginner in java. In javascript i have this regex: /[^0-9.,\-\ ]/gi How
I have a the following string: Source: HKID:A1234567~PKey:00888880~DOC:TKWC033330 Regex: .*(HKID:.*?)(.+?)((?=~)|\s|\z) When I test this
I have a regex to match email addresses in javascript. Lets see an example:
I have this JavaScript code: var textareas = document.getElementsByTagName('textarea'); var content = textareas[0].value; var
I have the following javascript code: if (url.match(/?rows.*?(?=\&)|.*/g)){ urlset= url.replace(/?rows.*?(?=\&)|.*/g,rows=+document.getElementById('rowcount').value); }else{ urlset= url+&rows=+document.getElementById('rowcount').value; }
I have a string that looks like this: <td width=308>Services Needed: <a href=javascript:void(null); title=weekly
I have a javascript regex which validates UK postcodes. It works well, but it
I'm a bit rusty on my regexp and Javascript. I have the following string

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.