hi,

i want aregular expression which allows numbers and one period

eg 325.50, 25.20

and allow only two didgits after the period

Recommended Answers

All 3 Replies

What's stopping you from making one?

i tried to create thr regular expression..

[1-9]+(\.[0-9][0-9])?

but this doesnt work ... actually i want this for validation purposes to check before saving to database thet price mathches the regular expression...

and one more thing whats the use of preceding @ symbol before wring a string in c#

eg; str = @"Select * from emp";

For starters, replace [1-9]+ with [1-9][0-9]*

When you use a preceding @ sign in C#, that means escape characters won't work. You can then write backslashes freely.

For example, @"C:\Documents and Settings\rashakil\My Documents\serkan love files" would be a valid string literal. If you want to write a double quote character in such a representation, I think (but you should double check that) you can write it by writing two double quote characters: @"blah "" hah" == "blah \" hah"

commented: The subtility of your style is by moments unsurpassable LOL! +4
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.