Click here to Skip to main content
15,879,490 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to write the Regexp for
+/-  


I tried like this
((ChrW(043)/ChrW(045))

but it did not not works at all.

Experts Suggest me to get the solution

Thanks in advance
Posted

1 solution

Assuming you mean "plus or minus" infront of a number for example:
123.45
+123.45
-123.45
Then it's simple:
[+-]
To allow either or nothing:
[+-]?
To allow neither followed by a floating point number:
[+-]?\d+(\.\d+)
 
Share this answer
 
Comments
[no name] 29-Jul-14 6:26am    
No,the actual word is +/- i want to write regexp for this
OriginalGriff 29-Jul-14 6:32am    
You are kidding, yes?
Try:
\+/-
[no name] 29-Jul-14 6:41am    
Not like that,I already tried this also,but if i check +/- it will modified as ± during run time. i don't know the reason for this that's why i can't get the solution.
OriginalGriff 29-Jul-14 6:58am    
Hang on, back up a couple of steps - it's possible we are talking at cross purposes.
Remember that we can't see your screen, access your HDD, or read your mind :laugh:
Please,try an explain exactly what you are doing and why it's causing a problem.
A code snippet might help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900