Regular expression issue

A

Ashok Prabhu

Hi,

The following is a sample of my problem. I get input from user and
store it in variable 'b'. I want to match the user input with the
contents of another variable 'a'. However I m not able to get the
exact match. Could someone help?
'c'

In the above example I want re to find the string 'c+' instead of 'c'.
I want a solution without escaping the '+' symbol with backslash
because it is given by the user.

Thanks,
~Ashok.
 
P

Peter Otten

Ashok said:
The following is a sample of my problem. I get input from user and
store it in variable 'b'. I want to match the user input with the
contents of another variable 'a'. However I m not able to get the
exact match. Could someone help?

'c'

In the above example I want re to find the string 'c+' instead of 'c'.
I want a solution without escaping the '+' symbol with backslash
because it is given by the user.
'c+'

But if you aren't interested in anything but string literals, you should use
string search:
6

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top