C# Regex class with Timeout

Ukończone Opublikowano Sep 28, 2006 Płatność przy odbiorze
Ukończone Płatność przy odbiorze

Hi we have an application that lets people provide a regular expression via an textbox and then processes some text using the C# regex class. The problem we have right now is that sometimes users can put in regex that take a long time and the app just hanges. We would as a result like to have a way to let a C# regex timeout.

The deliverable for the project is a class called RegexWT. This class should have the same methods as Regex (and even possibly inherhit from Regex) save for that the worker methods like Match and Replace provide an addition long parameter called "timeout" which allows you to specify a timeout in milliseconds.

In the event that the regex processing goes over the timeout, the call should return.

The usage should be just like Regex:

string regexstr = "[\\s*Mybadregex*;][1]";

RegexWT regexwt = new RegexWT(s, [url removed, login to view] | [url removed, login to view] | [url removed, login to view]);

string temp = "Here is a string to parse";

temp = [url removed, login to view](temp, "", 30000); //times out after 30 seconds

It would seem after some research that the way to accomplish this is to have something wrap regex and run asynch and then if the operation does not complete kill the thread.

This technique is discussed here:

<[url removed, login to view]>

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.

b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.

3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

## Platform

.net 2.0 (vs2005)

windows xp or better

Programowanie w C# Inżynieria MySQL PHP Architektura oprogramowania Testowanie oprogramowania

Numer ID Projektu: #3826093

O projekcie

6 ofert Zdalny projekt Aktywny Sep 28, 2006

Przyznany użytkownikowi:

wavemaker

See private message.

$55.25 USD w ciągu 14 dni
(7 ocen)
3.4

6 freelancerów złożyło ofertę za $61 w tym projekcie

muskad202

See private message.

$25.5 USD w ciągu 14 dni
(123 Oceny)
5.7
tungstensol

See private message.

$58.65 USD w ciągu 14 dni
(1 Ocena)
0.8
nikusoftinc

See private message.

$68 USD w ciągu 14 dni
(0 Oceny)
0.0
pgcodingvw

See private message.

$85 USD w ciągu 14 dni
(0 Oceny)
0.0
vrbitmen

See private message.

$76.5 USD w ciągu 14 dni
(0 Oceny)
0.0