Welcome :Guest
Congratulations!!!

Top 5 Contributors of the Month
Abhijit

### regular expression alphanumeric all text not contains !

hello all am performing a 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]$") ### Security Briefs: Regular Expression Denial of Service Attacks and Defenses Microsoft security expert Bryan Sullivan believes denial-of-service blackmail attacks will become more common as privilege escalation attacks become more difficult to execute. He demonstrates how to protect your apps against regular expression DoS threats. Bryan Sullivan MSDN Magazine May 2010 ### Help with regular expression Hello, I am using this regular expression: /.*-lyrics-.*$

and I need the expression find urls like this:
http://domain.com/lor-mbongo-lyrics-loboko-txphzzf

and it do really does that!

The problem is that it finds also this URL:
http://domain.com/lost-lyrics-5mk4f/lyrics

Whar regular expression should I use to exclude urls that end with /lyrics ?

Thanks :]

### Regular Expression to Match in HTML

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

\<table .*\>

\</table\>

The problem is to match the whole table span over multiple lines

<table cellspacing="0" rules="all" border="1" id="dgSchedule" style="border-style:None;height:100%;width:100%;border-collapse:collapse;">
<tr class="blackbar" align="center" style="background-color:#7FB4DE;font-family:Verdana;font-weight:bold;height:20px;">
<td>From Place</td><td>To Place</td><td>Time</td><td>Bus Type</td>

</tr><tr style="background-color:#DEECF5;">
<td>1</td><td>2</td><td>00:15</td><td>Express</td>
</tr><tr style="background-color:#EFF5FA;">
<td>2</td><td>3</td><td>00:15</td><td>Express</td>
</tr><tr style="background-color:#DEECF5;">

<td>3</td

### Need a regular expression

I have a required field validator for a texbox, but I just found out that the texbox can have a space in it (for a delimiter, let's say).

I checked the .net and regexlib.com, but couldn't find what I was looking for.

I simply need a regular expression that basically excepts any character string including spaces in it or even a space by itself

Can someone help me out?

### regular expression

hi...can anobody help me that how to write regular expression for textbox..such as the textbox should accept only numbers otherwise alert msg should be displayed ..displaying that u cannot enter the charcter in the textbox..i want this in javascritp..

### Matching set of characters via regular expression

I need to be able to match sets of quote and space characters in a string and replace these accordingly. I currently have this done in 2 lines of code, but would like to use regular expression so that I can use only 1 line of code. See below: var Qt = unescape("%22"); //quote char var Sp = unescape("%20"); //space var Cr = unescape("%0d"); //carriage return var Lf = unescape("%0a"); //line feed var CrLf = Cr + Lf;  //carriage return & line feed stringOut = stringIn.replace(Qt+Qt+Sp+Qt,Qt+Qt+CrLf+Qt); stringOut = stringOut.replace(Qt+Qt+Sp+Qt+Qt,Qt+Qt+CrLf+Qt+Qt);   I want to replace space in string like in pattern below with carriage return line feed: (in hex) 22 22 20 22 or 22 22 20 22 22. This needs to return 22 22 0D 0A 22 or 22 22 0D 0A 22 22   Line in green above will only match and replace 22 22 20 22 , but I want have regular expression into 1 line of code which  will match and replace either 22 22 20 22 or 22 22 20 22 22

### Regular Expression for Digits, comma & space combination

Hi Can you suggest a Regular Expression for the following category. A text box which should contain: Max size : 53 0-9 digits + a comma + a space The 0-9 numbers should be repeated 5 times and separated by a comma and a space Eg: 123456789, 123456789, 123456789, 123456789, 123456789 Thanks, David.

### regular expression: Read a multi line paragraph

I am trying to build a regular expression that will capture a paragraph of any length that starts with "Ordinance Summary:" and ends with "<=>" but doesn't actually include them in the selection.  And I need it to stop at the first instance of <=>. Here is an example of what what I might encounter: "Ordinance Summary: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin pharetra nonummy pede. Mauris et orci. Aenean nec lorem.<=> Ordinance Sponsor:Rhuarch<=>"   And here is what I would need it to actually capture: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin pharetra nonummy pede. Mauris et orci. Aenean nec lorem.   And here is the expression I tried which didn't work: (?<=Ordinance Titl

### regular expression for file upload box

I have a regular expression that check for filenames in upload file dialog box . The main aim is to disallow any special characters in filenames.  ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w\-\. ]*))+\.([a-zA-Z]*)$" But this one will not allow filenames with back slashes   I want to modify the reg ex to except both of the following type filenames c:\temp\abcd.txt  and also the way filenames are displayed in firefox browser (with backslashes) file:///c:/BIDS2/abcd.txt   I need help with modifying the regex, so that it excepts both   Thank you

### Function count through Regular Expression

Hi, I have a table with varchar(max) column. This column stores all the function calls to application. Example 1    SUM(SALARY); AVG(LEAVES)/COUNT(DAYS); 2    SUM(SALARY)/AVG(SALARY); AVG(LEAVES)/COUNT(DAYS); COUNT(EMPLOYEES); The above output shows the requests of User 1 and 2. User 1 called SUM, AVG and COUNT functions once. User 2 called SUM once and AVG, Count twice. I need to calculate these counts through Regular expression in SQL Server 2005. Following is script for table and data generation: CREATE TABLE [dbo].[UserRequests] (  [UserID] [int] NOT NULL,  [Requests] [varchar](255) NULL ) ON [PRIMARY] insert into [dbo].[UserRequests] values (1, 'SUM(SALARY); AVG(LEAVES)/COUNT(DAYS);') insert into [dbo].[UserRequests] values (2, 'SUM(SALARY)/AVG(SALARY); AVG(LEAVES)/COUNT(DAYS); COUNT(EMPLOYEES);') Any suggestion or idea would be highly admired. PS: if someone has another optimized solution for this problem, kindly suggest that as well. Regards.

### How to read string end with question mark in regular expression?

Hello, I'm facing problem when I read string which is ended by question mark. I use in my code as the following. \"?(?<myfield>[^\"]?.*[^\"?]?)\"? If string is ended by question mark, it's not working. Please help me to solve my problem. Thanks. Co Coe

### How can we use a phrase in regular expression?

Dear Friends,   I have a pattern like this "Reg-voucher-[0-9][0-9][0-9]". the "Reg-voucher-" must be fix and tree digits are variable. how can I write its pattern?   Thanks for your help

### Regular expression: Replace anything that isn't alphanumeric with a space?

Hi there,I'm writing a function in C# that will clean up a filename that a user might upload.One of the requirements is to replace any character that isn't alphanumeric with a space, but I can't seem to get the regular expression working to do so?I've include my code below, thanks for any help :)// Replace miscellaneous characters with a space inputFilenameRegex = new Regex(@"^[a-zA-Z0-9]"); inputFilename = inputFilenameRegex.Replace(inputFilename, " ");
 Categories:
 ASP.Net Windows Application .NET Framework C# VB.Net ADO.Net Sql Server SharePoint Silverlight Others All