Regular Expression For Validate Alphanumeric String?
May 4, 2010give me Regular expression for validation string that must have at least one alphabet and at least one numeric value?
View 7 Repliesgive me Regular expression for validation string that must have at least one alphabet and at least one numeric value?
View 7 Repliesa validation on textbox I need to make it match this
"CharactersNumbers"
the regular expression must match the whole word , not just contains !! I am writing this one but it's not giving right results
Regex alphaNumbericStringRegex
= new
Regex("^[A-Za-z0-9]$");
i have to check if an input string is valid based on the given regular expression.. this is the regular expression.
(a(bb+aaa+((ab)*bb+(aba)*aa)(a+b)*) + (b(aa+bbb+((ba)*aa+(bab)*bb)(a+b)*)
+ is an OR
* is a LOOP, it is optional, it may be done as many as a user wants.
i've tried many ways to solve the problem that my professor gave me but my knowledge isn't that enough to solve this problem..
i'm stuck with password validation in c#.
I'm using regular expression to validate the string.
Password criteria is alphanumeric.
The password must have atleast one number(0-9), atleast one character(a-z or A-Z)
i need a regular expression for validate authors of bookssomething like:
John, D.
John, D.O.
John, D.O.E.
i mean First Char UPPER ended with, the 1 or many initials UPPER separated with.
I want to validate a textbox with regular expression so you only can enter numeric characters, but now I want that the error validation appear if the textbox be empty. here is the code
Types.Add("NUMBER",
new
Validation(@"[d]{1,255}","Only
numbers can be entered in this field."));
i want to validate my textbox where following things are not allowed
1) phone no
2) email
3) internet url
i want to use regular expression
I want That validate the textbox so this no be empty I put that
"[ws]{1,50}"
But I want that the error mark when the textbox be empty.
I am looking to find a regular expression that conforms to military addresses.
View 2 RepliesI'm looking to validate the length of a textarea using a regular expression validator. It should allow all characters and crlfs. I'm also concerned about crlfs counting as 1 or 2 characters, I'm concerned it may be different across browsers but I'm hoping ASP.NET regulates it. Also, I'm saving to a mix of varchar and nvarchar fields in MSSQL, do I need to be concerned about the way crlfs are saved there? I'm in a hurry to do this right, so I'll be researching all this on my own but I'm just hoping someone out there might have experience handling such concerns.
View 1 RepliesI would like to validate the textbox for specific text and it must not be blank. But the regular expression validator is not validating if the text box is BLANK. However, it validates if I type something in the text box.
How can I make regular expression to trigger even if the text box is empty?
Should I use Required Validator + Regex Validator at the same time?
<asp:TextBox ID="txtcard" runat="server" MaxLength="16"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="txtcard" ErrorMessage="Please type credit card no"
ValidationExpression="^d{16}$"></asp:RegularExpressionValidator>
i want a regular expression to validate path. THe path is :
 Server.MapPath("../Error/Feedbackdoc/" & fid & ext)
& fid & ext is the file which is uploaded.
i want to validate the path i.e. Â ../Error/Feedbackdoc/ and rest can be name of uploaded file.
how to use regular expression in vbscript to validate username field. ie it should have minimum of 4 characters and at the same time it should contain minimum of 3 ALPHABETS. ie
1234 - not allowed
abc1 -allowed
My code
dim regObj,retVal
set regObj = new RegExp
regObj.Pattern ="[A-Za-z0-9_s]{4,}"
regObj.IgnoreCase = true
regObj.Global=True
retVal = regObj.Test(sString)
I'm using RegularExpressionValidator controls to impose password rules when creating new passwords. I want to avoid repeatitons such as 'aaaa' or sequences such as '12345' in the password.
How do I write the validationexpression to a RegularExpressionValidator to impose this rule? I do not want to do thing using C#, just with a regular expression that could be put within the validator control like below:
<asp:RegularExpressionValidator
ID="RegularExpressionValidator3"
runat="server"
ErrorMessage="Password
should contain Minimum 8 Characters"
ControlToValidate="txtPwd"
ValidationExpression="w{8,30}"><asp:RegularExpressionValidator>
I am really struggling with this! Using the regular expression validator I created an expression, thus ":" to show an error message if the user tries to enter in a name that contains a colon. What I am getting is the error message showing even when there is no colon (:) in the string. What am I doing wrong?
View 4 RepliesI have the following regular expression replacement:
[Code]....
how to exclude certain string
I am working on a web application in which I am getting a string from database and breaking it to use it. This is the string: string str = "DB1031229";
But sometimes I am not getting proper results. I need to break it in :
DB
10
1229
You can notice that I have not included 3 in that. I dont need that.
I'm having a TextBox and it can be accept only the string like "49=N,38=S,56=S,......"
so can u tell me how can i create my regular expression for validate above string.
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 am new to regular expression. Could you give me the syntax in asp.net??
The textbox string should be int value, non zero, non-negative.
I am trying to capture instances of '&#' in a string using a regular expression.
The best validation expression I can come up with is [^&#]*
This captures &# but unfortunately also captures & and # on their own.
How do I make the expression only look for &# together?
I'm trying to write a validator for an ASP.NET txtbox.
How can I validate so the regular expression will only match if the 6th character is a "C" or a "P"?
I need a way to create a regular expression from a string or an array of domain names. for example string array = [URL]. Once I click save I would want to create a regular expression that would match all 3 with or without '.com' extension. Then Another task would be to pull this data out of regular expression and put it back into an array.
View 5 Repliesunderstood me how can i make a regular expression that allow all the mismatch case and don't a match case
ex: ".aspx"
( when i put any thing in text box it allow ----a ,ab ,adn.jpg ) result=true (but when i put =.aspx ) result= false
I'm trying to use the validator to work on a email form to ensure that they enter a valid from email address. That part works. I also want to add to the expression the text that I pre-populate in the txtbox ("Enter your email address") so on postback, after sending the message, I can clear the fields and repopulate that box.
How do I add that wording to the current expression: w+([-+.']w+)*@w+([-.]w+)*.w+([-.]w+)*