Using Regular Expression Text Box Should Accept 1 Or 2 Or 3 Or 4 Or 5 Max Digits Numbers Only Restrict Decimal Part?
Jan 12, 2011
I need to validate the text box at server side by using regular exp which should accept 1 or 2 or 3 or 4 or 5 digits numbers .Need to restrict decimal part.
Ex: 1 or 23 or 455 or 5643 or 45667 --Should accept.
1.3, .2, 33.3 , 444.55 ,5555.99 -- should not accept.
in my web application i want to validate that user can enter only digits and the digit may be a integer or decimal how can i write the regular expression for this.
how to write a regular expression that accepts no less than 10 digits and no more than 11. i need it to validate a textbox for phone number. i have searched the web but i cant seem to find any.
I have this regular expression, for currency, which only accepts number and a decimal, however it takes digits starting with zero, like 09788,08383 how can i eliminate this bug from this regular expression here is the regular expression ^d{1,9}(.d{1,2})?$
Suppose i have this input string "3rd position 5th time"
I want to write a Regular Expression to get 3 and 5 in a String like this "3 5" i.e., 3 and 5 both will be in a String but having a space. 3 and 5 may be any numbers like 12 or 13 ony any other numbers. For this i wrote this Regular Expression
Dim regexpression As String = "^[0-9]*+[0-9]"
but its not working .I am unable to get the logic.
I have a text box which accepts CVV code of 3 or 4 numbers and im using regular expression validator this is wat im using : is this correct way of using or not
I need to construct a regular expression for the password textbox which shouldn't accept special characters($,@,!,etc).Even whitespaces,tabs. I tried the below this accepts special characters.
<asp:RegularExpressionValidator ID="RegEx" runat="server" ControlToValidate="Password" ErrorMessage="Password must be atleast 8 characters and include a number,alphabets upper case and lower case. "ToolTip="Password format is not correct" ValidationExpression="^(?=.{8})(?=.*d)(?=.*[a-z])(?=.*[A-Z]).*$"> </asp:RegularExpressionValidator>
I was read your post: "Export GridView to Excel in ASP.Net with Formatting using C#" and is very useful. That code works perfect. But I need create a new format for a specific column in my sheet before to export it. For example:My DataTable have a column with decimal numbers and I'm trying reduce the tenths for each number.I want this: 2,874444 ----> 2,87 for a specific range. In this case I need it for all numbers in the column 13 or well said for the Column called N in Excel. Only reduce two tenths.
There may be an easier way, and if there is I'm all for it. However - my ASP.NET page has a TON of controls on it, and I've given them all ID's that start with underscore. I copied all the markup into Notepad++ and I'm trying to find a regular expression that will find everything but the controls and replace it with whitespace. that way I'll have a text file that has all my control names which I'll probably throw into Excel and do some string manipulation to add ".Text = " etc.
This is slightly different to most questions regarding HTML tags in strings - I want to add HTML!
I'm using a WYSIWYG editor which produces some eratic results. What im looking to do is to check the string it produces and check whether there are any sentences that aren't wrapped in a <p></p> tag. Typical strings could be: