More Related Resource Links

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.

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

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

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.

Hi everybody,i am stuck in generating a regular expresion for this typem/dd/yyyy hh:mm:ssbecause i am dealing with some date values, for example i haveÃÂ date values like bellow, 3/29/2007 13:28:343/27/2007 17:12:36so i need to find out a regular expression type in order to validate this, i already got some regular expression string like this ,^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)[0-9]{2}$but this is working only for 03/29/2007but if i use 3/29/2007 it wont work , or if use 03/27/2007 17:12:36 still it wont work so i really need you guys help on this to generate my regular expression string thanksregrdssukavi

I am clueless when it comes to building regular expressions. I know what they are, but haven't been able to master them. I found this regular expression which will validate a Sprint/Nextel Direct Connect number - all numbers, only asterisks allowed.
^\d+\*\d+\*\d+$
http://www.regexlib.com/REDetails.aspx?regexp_id=1730
Can someone modify it for me so that it checks for a minimum and maximum number of numbers in the string and checks that there are (2) asterisks?
If you can use a minimum of (6) and a maximum of (12), I should be able to figure out how to modify it myself after I call Sprint on Monday.
David H

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

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.

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

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, " ");

Hi
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?
Thanks