Regular expression optimization
- From: "Billa" <BillaTilla@xxxxxxxxx>
- Date: 26 Jan 2006 06:40:13 -0800
Hi,
I am replaceing a big string using different regular expressions (see
some example at the end of the message). The problem is whenever I
apply a "replace" it makes a new copy of string and I want to avoid
that. My question here is if there is a way to pass either a memory
stream or array of "find", "replace" expressions or any other way to
avoid multiple copies of a string.
Any help will be highly appreciated
Regards,
Billla
Example:
'Delete all namespaces from <multistatus> root element
Pattern = "\<a\:multistatus [^>]*\>"
ReplaceWith = "<a:multistatus>"
sContents = Regex.Replace(sContents, Pattern, ReplaceWith,
RegexOptions.IgnorePatternWhitespace)
'Step#8-B.
'doing the closing tag part
Pattern = "\<\/response\>"
ReplaceWith = "</nsResp:response>"
sContents = Regex.Replace(sContents, Pattern, ReplaceWith,
RegexOptions.IgnorePatternWhitespace)
.
- Follow-Ups:
- Re: Regular expression optimization
- From: rossum
- Re: Regular expression optimization
- From: Kevin Spencer
- Re: Regular expression optimization
- Prev by Date: Re: Create an HTML file
- Next by Date: Re: Please recommend an UML for dotNet development
- Previous by thread: adding a textbox (searchbox) to the windows taskbar
- Next by thread: Re: Regular expression optimization
- Index(es):
Relevant Pages
|
Loading