Web Forms :: How To Create Regular Expression For String
Mar 4, 2010I'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.
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.
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 Repliesi 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 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 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 RepliesHow would I create a regular expression validator for a textbox, to limit the input to a decimal number between .1 and 1?
View 1 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.
give me Regular expression for validation string that must have at least one alphabet and at least one numeric value?
View 7 RepliesSuppose 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 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 need to construct a regular expression for the password textbox, Min:8,Max:16 and must include atleast a number(0-9),alphabets upper and lower case. I am unable to limit the length to 16.
<asp:RegularExpressionValidator ID="RegEx" runat="server" ControlToValidate="Password"
ErrorMessage="Password must be min:8,max:16 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'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 want to create Regular Expression for phone number and valid digits allowed are (,),-,+,0----9. If the left bracket ( is there,then its necessay that right bracket is also there. How to create the Regular Expression for the above. I dont know how to create the regular Expression,
View 4 Replieswhat regular expression should i use to validate cricket overs in textbox. like it can be 5.1, 5.2,5.3,5.4,5.5 but it should not contain fraction value greater than .5 ,also the values should be numeric only (float and int)
View 3 RepliesI'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+)*
I am using Regular Expression validator for a text box. The below is working fine.It is not performing validation when I enter values like 0000..001.How can I modify validation expression? But it would allow values like 100,...5000 i.e zeros after a number.
<asp:RegularExpressionValidator ID="reg2" runat="server" ControlToValidate="rng2"
ValidationExpression="^[0-9]+" ErrorMessage="*Please Enter a Valid Number for Second Range."
ForeColor="Red" Font-Bold="True"></asp:RegularExpressionValidator>
understood 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 need some help in regular expression.I am validating the textbox text when updating the records.When i click the update button,the first 5 letters should be equal to CM000 or cm000.How to validate this using regular expression in asp.net. does anyone know validationexpression for this.
View 1 RepliesIf i am giving the text
hjghj bvgfh . it is failing
I am a new to regular expressions.I need to validate an identification number so that the textbox doesn't accept numbers like 1111111, 2222222, 3333333......9999999 and 1234567, 2345678, 3456789.Could someone please post regular expression for not accepting such format.
View 4 RepliesI have a Regular Expression ^[a-zA-Z''-'s]{1,40}$ Now i want to allow DOT (.) in this expression so hows its possible to add DOT in this expression.
View 3 RepliesI have a regular expression validation set on text box. I have a grid on the same page with edit and delete buttons. In some cases I don't want the regular expression to fire. For example, I have a scenario where the text box will be disabled but I can still enter data in to the grid and modify it, but the regular expression fires when I modify the grid and the changes in the grid are not processed.how can I stop the validation when I am working on grid. I can see a property causes validation for button to stop validation but don't know how can I stop for the grid.
View 3 Repliesi want to find and replace img src path by regular expression.suppose i have the below html and from there i want to replace file path of all the src attribute of image tag.
<P>Hello</P>
<P> </P>
<P><IMG alt="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg" src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg"></P>
here the file path is src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg"
and i want to replace it with path like src="www.mysite.com/images/a.gif" with regular expression.how can i do it with regular expression.
I am facing a problem for doing URL validation which should allow atlest two periods in the URL.If the URL does not contain atleast two periods then it should throw an error. Also the regular expression must obey all the URL validations.Please help GURUS it is urgent for me to get some solution.
View 6 Replies