Solved

regular expression handling apostrophe

Posted on 2014-04-15
7
301 Views
Last Modified: 2014-06-01
Hi Experts,

I went to the following link and tried to modify the rgeular expression so it accepts the apostrophe but couldnt,



I need your help to solve this problem.

Please post the working solution.

Thanks
0
Comment
Question by:bachra04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 2

Author Comment

by:bachra04
ID: 40003136
Sorry here is the link:

http://jsfiddle.net/CsQn7/98/
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 40003149
var r = new RegExp('^[\'a-zA-Z0-9\\*]\\\\]\\*$');

HTH,
Dan
0
 
LVL 2

Author Comment

by:bachra04
ID: 40004113
I don't know why right now the test is giving me false for any value I enter.

http://jsfiddle.net/CsQn7/98/
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 40005196
It gives true for the value:
f\]*

Open in new window

Did you want to match a literal backslash character?
0
 
LVL 9

Accepted Solution

by:
Derek Jensen earned 500 total points
ID: 40007049
http://jsfiddle.net/CsQn7/98/ returns true for an apostrophe using this line:

var r = new RegExp("^['a-zA-Z0-9\*]\\\]\*$");

Open in new window

0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question