Development

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Anyone Have Problems With RegexOptions.Singleline in aRegex.Replace?

    0 answers - 983 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I'm trying to use the following code to read in a file on my web server
    and display part of its contents (sorry for wrapping):
    StreamReader streamReaderFile = new StreamReader("/path/to/file.html");
    string stringFile = streamReaderFile.ReadToEnd();
    stringFile = Regex.Replace(stringFile,
    @".*<!-+\s\s*START\s*HERE\s\s",
    "<br>", RSingleline);
    But the web server seems to be timing out on the third line, where the
    Regex is executed. It doesn't time out if I don't use the Singleline
    option, but then of course it doesn't do what I need it to do. It's
    supposed to be just getting rid of everything in the HTML file up to and
    including a comment I placed there:
    "<!-- START HERE "
    Any ideas what I'm doing wrong?
    Regards,
    David P. Donahue
    ddonahue (AT) ccs (DOT) neu.edu
    http://www.cyber0ne.com
    Mono-list maillist - Mono-list (AT) lists (DOT) ximian.com

Re: Anyone Have Problems With RegexOptions.Singleline in aRegex.Replace?


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
QUESTION ON "Development"

EMSDN.COM