473,382 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Using Regular expression to replace escape characters

I have a string with some escape charaecters that need to be processed in our
file
Say for example the string might have something like following
<escape V=".sp2" />
step 1:
This has to be replaced to "escape V=".sp2"
step 2:
Later it has to be reversed as original(<escape V=".sp2" />) after some
processing.

We need a soln with respect to regex in C#.

There may may be many instances od this string in the file.so we need to
replace all instances.Please provide a solution

--
Guhan
Apr 3 '07 #1
1 1857
"Guhanath" <Gu******@discussions.microsoft.comwrote in message
news:2F**********************************@microsof t.com...
>I have a string with some escape charaecters that need to be processed in
our
file
Say for example the string might have something like following
<escape V=".sp2" />
step 1:
This has to be replaced to "escape V=".sp2"
step 2:
Later it has to be reversed as original(<escape V=".sp2" />) after some
processing.

We need a soln with respect to regex in C#.

There may may be many instances od this string in the file.so we need to
replace all instances.Please provide a solution
If you just want to know how to set up a parser for regular expressions in
C# , use the following code segment as a guide:

Regex rex = new Regex(".*?;");
string answer;
byte[] out_string;
uint result;
for(Match m = rex.Match(CommBuffer); m.Success; m = m.NextMatch())
{
answer = parser.Get(m.Value);
out_string = AE.GetBytes(answer);
result = SIO.put(out_string, (uint) out_string.Length);
CommBuffer = CommBuffer.Replace(m.Value, "");
}
--
================================================== ====================
Joseph "Beemer Biker" Stateson
http://ResearchRiders.org Ask about my 99'R1100RT
================================================== ====================
Apr 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: M Wells | last post by:
Hi All, I couldn't find a regular expressions group to ask this in, so I thought I'd ask here as I'm a little familiar with php's regular expressions syntax. I have a comma delimited text...
5
by: Henry | last post by:
I have this simple code, string escaped = Regex.Escape( @"`~!@#$%^&*()_=+{}\|;:',<.>/?" + "\"" ); string input = @"a&+" + "\"" + @"@(-d)\e"; Regex re = new Regex( string.Format(@"(+)", escaped),...
9
by: Harry | last post by:
Hi there, does anyone know how I can build a regular expression e.g. for the string.search() function on runtime, depending on the content of variables? Should be something like this: var...
11
by: Dimitris Georgakopuolos | last post by:
Hello, I have a text file that I load up to a string. The text includes certain expression like {firstName} or {userName} that I want to match and then replace with a new expression. However,...
1
by: Craig Kenisston | last post by:
Hi, I need to write a function that should behave like the SQL's "like" operator on a list of words. I was wondering if I can use Regex directly to do this job. But I've been reading about...
6
by: Ioannis Vranos | last post by:
Given the regular expression: S"^(+|+\\s+)$" 1) Isn't the "+|+" part redundant? As far as I can understand it means exactly the same as "+" alone. 2) Isn't the parenthesis grouping...
4
by: seannakasone | last post by:
Is there a way to search a string for a whole word w/o using a regular expression? i.e. mystring.IndexOf(mypattern, *WholeWord); The reason i rather not use a regular expression is because...
24
by: garyusenet | last post by:
I'm working on a data file and can't find any common delimmiters in the file to indicate the end of one row of data and the start of the next. Rows are not on individual lines but run accross...
0
by: peridian | last post by:
Hi, I wanted a web page where I could post code to, and have it appear in coloured formatting based on the context of the code. Most of the techniques I have seen for this involve complex use...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.