Write A Regular Expression That Will Match If The 6th Character Of A String Is One Of Two Different Letters?

Jul 21, 2010

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"?

View 5 Replies

Similar Messages:

Web Forms :: Regular Expression - Match Any Character INCLUDING A New Line?

Sep 8, 2010

I'm testing out a CMS I've built in ASP.NET and I'm having issues validating a form textarea with a regular expression.

I've used a ReguarExpressionValidator control to make sure a maximum of 4000 characters are entered but have realised I'm not including line breaks in the regular expression and can't figure out how to include them?


View 1 Replies

Regular Expression Letters Only?

Nov 19, 2010

I would like to know what the expression for "letters only" is for my asp.net web application. I tried ^[A-Za-z] but it does not work I would also like a regular expression for "numbers only except "-"

View 3 Replies

Regular Expression For Sequential Numbers Or Letters?

Nov 22, 2010

Need reg exp for following.

May not repeat same number or letter more than 3 times.

May not contain more than 3 sequential number or letters in a row.

View 5 Replies

Web Forms :: Regular Expression Validator For Letters Only?

Jul 2, 2010

what is the regular expression validator for letters only?. I have tried this"[a-zA-Z]" and "[a-z][A-Z]" with no luck..

View 4 Replies

C# - Validations For Regular Expression With Numbers Only And It Should Not Allow Spaces And Letters?

Jun 3, 2010

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

code : ValidationExpression="(d{3,4}$"

View 1 Replies

Regular Expression / Input String Is Valid Based On The Given Regular Expression?

Sep 20, 2010

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..

View 3 Replies

Regular Expression For Exact Match

Mar 16, 2011

I am reading .css fle which is having following 2 css classes:


View 11 Replies

Regular Expression To Match 10-14 Digits?

Apr 24, 2010

I am using regular expressions for matching only digits, minimum 10 digits, maximum 14. I tried:


View 5 Replies

Reg: Regular Expression Patterns To Match For The Example

Nov 20, 2010

I want a regular expression patterns to match for the following example.


I need only the USER to be extracted from those.

View 2 Replies

Web Forms :: Regular Expression To Match In HTML?

Aug 22, 2010

Here is the kind of text I want to match via a regular Expression

The id="dgSchedule" is always present in the TAG but its location may differ

The table is span over multiple line/contains white spaces/tabs...

I have the regular expression to match the start and end tag respectively over a single line


Is there any regular expression generator available that can generate me a regular expression based on the text I select and the parameters I specify?

View 6 Replies

Web Forms :: Finding Regular Expression To Match...

Feb 10, 2010

can someone tell me the regex pettern to match a string from [a-zA-Z] where each character in the group cannot occur more than n number of times.

View 8 Replies

Regular Expression To Match Maximum Of Five Words?

Apr 9, 2010

I have a regular expression


which validates that the word contains alpha-numeric characters and few special characters and length should not be more than 5 characters.

How do I make this regular expression to accept a maximum of five words matching the above regular expression.

View 3 Replies

C# - Regular Expression To Match IP Address + Wildcard?

Jun 8, 2010

I'm trying to use a RegularexpressionValidator to match an IP address (with possible wildcards) for an IP filtering system.I'm using the following Regex:


Which works fine when running it in LINQPad with Regex.Matches, but doesn't seem to work when I'm using the validator.Does anyone have a suggestion as to either a better Regex or why it would work in test but not in situ?

View 5 Replies

Regular Expression Word Matching - How To Match Three Words

Aug 19, 2010

I am writing a Regular Expression in IIS Rewrite Module 2.0. I would like to check for 3 words if this is true then i have a redirect action in place.

My Reg Ex is :-


When i run a test and i put in my string it matches but it doesn't appear to work in the browser?

how i can match 3 word :- Http , SomeWord1 , SomeWord2

I have googled but i can't seem to find anything that works.

View 1 Replies

C# - Define The Regular Expression To Match The Following Html Code?

Oct 29, 2010

I was doing some web scraping and i was looking for some div elements with particular class names and markup. This is my objective , i have to extract everything within the div having the class s_specs_box s_box_4 Could someone provide the regular expression in .NET terms (i.e., which can be straight away passed into Regex's constructor)to match one such div (given below)

<div class="s_specs_box s_box_4"><h3>Display</h3><ul><li><strong><span class='s_tooltip_anchor'>Display:</span>
<span class='s_tooltip_content'><p class='s_help'><b>Display</b> - Phone's main display</p></span></strong><ul>
<li class='clear clearfix'><strong><span class='s_tooltip_anchor'>Type:</span>
<span class='s_tooltip_content'><p class='s_help'><b>Type</b> - Refers to the type of the display. There are four major display types: Greyscale, Black&White, LCD:STN-color and LCD:TFT-color</p></span></strong><ul><li>Color</li></ul>
</li><li class='clear clearfix'><strong><span class='s_tooltip_anchor'>Technology:</span>
<span class='s_tooltip_content'><p class='s_help'><b>Technology</b> - Refers to the type of the color displays. There are five major types: LCD, TFT, TFD, STN and OLED</p></span></strong><ul><li>Super AMOLED</li></ul>..............................

View 3 Replies

C# - How To Encrypt String In Which Result Are Letters Or Numbers Only Without Any Other Character

Aug 21, 2010

I use some code to encrypt & decrypt string in C# but i want a good one that can generate encrypted string that contain only letters or numbers not any other ( + , / , ...)

View 1 Replies

Regular Expression To Avoid Space And Special Character?

Oct 1, 2010

I would like to have an regular expression that does not allow any spaces(before,within,after the word) and alphanumeric characters.

View 3 Replies

Web Forms :: Regular Expression - Check Length Of Textbox Less Than 200 Character

May 1, 2010

i have a textbox in my web form and i want to input any word with any character. so, only i want to check length of textbox less than 200 character. how can i do it with regular expression? and if i want to block some character how can i do it?

View 3 Replies

How To Write Custom Regular Expression

Feb 24, 2011

I Would like to write a custom regular expression where the format is like XYZ-ABC-001 where XYZ is fixed, ABC is variable (it can be any three characters between A-Z )001 is variable (it can be any number between 0-9)

View 2 Replies

Write .NET Regular Expression For Floating Value (5,2) ?

Feb 8, 2011

i need to write a regular expression for float value (5,2)

As per my understanding (5,2) means

Total length cannot exceed 5 digits i.e. 999.99

Digits before decimal is 3 and after decimal is 2 i.e. 999.99

I wrote this: ValidationExpression="(^d{0,3}[.]?d{0,2}$)" but this is accepting 9999 and 99999 which is wrong because in both case before decimal is more than 3 digits.

View 5 Replies

Only Digits, The Digit May Be Decimal / How To Write The Regular Expression

Jan 27, 2010

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.

View 2 Replies

SQL Server :: Conversion Failed When Converting From A Character String To Uniqueidentifier - Match A Username To A Userid

Oct 12, 2010

I am trying to match a username to a userid which are in 2 different sql tables. Here is my select statement:

SELECT aspnet_Users.UserName
FROM aspnet_Users INNER JOIN
aspnet_starterkits_Projects ON aspnet_Users.UserName = aspnet_starterkits_Projects.ProjectManagerId

When I run this i get an error message: "Conversion failed when converting from a character string to uniqueidentifier" Is there anyway around this? Or a different select statement etc?

View 8 Replies

SQL Server :: Regular Expression - Write SQL SELECT Statement To Determine If The Value In Table1?

Aug 18, 2010

I'm writing a SQL query where I need to detect if the value of an integer column in one table is contained within the value of a varchar column of another table. For example:

Table1 has columns A, B, C

A = 1

B = 2

C = 3

Table2 has columns D, E, F

D = "1,2,3,4,5"

E = "2, 5, 10, 15"

F = "1, 3, 49"

How would I write SQL SELECT statement to determine if the value in Table1.A is in Table2.D, Table1.B is in Table2.E, and Table1.C is in Table2.F?

View 7 Replies

Regular Expression For Looking For Colons (:) In A String / Error There Is No Colon In String

Sep 2, 2010

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 Replies

Copyrights 2005-15 www.BigResource.com, All rights reserved