[Mono-list] C# Regular Expressions Help Urgent
LaVey
LaVey" <lavey@pacific.net.sg
Sat, 9 Aug 2003 18:40:42 +0800
Thanks Philip...
Best Regards,
Nigil
----- Original Message -----
From: "Philip Van Hoof" <spamfrommailing@freax.org>
To: "LaVey" <lavey@pacific.net.sg>
Cc: <Mono-list@lists.ximian.com>
Sent: Saturday, August 09, 2003 6:27 PM
Subject: Re: [Mono-list] C# Regular Expressions Help Urgent
>
> In Regular Expressions, the [ and ]-chars must be escaped, like :
>
>
> [freax@pluisje freax]$ cat test.cs
> using System;
> using System.Text;
> using System.Text.RegularExpressions;
>
> public class Test
> {
> static public void Main ()
> {
> string str_Content="The day is [so bad] for me";
>
> str_Content = Regex.Replace(str_Content,
> "\\[so Bad\\]",
> "[new replace string]",
> RegexOptions.IgnoreCase);
>
> Console.WriteLine (str_Content);
> return;
> }
> }
>
> [freax@pluisje freax]$ mono test.exe
> The day is [new replace string] for me
> [freax@pluisje freax]$
>
>
>
> On Sat, 2003-08-09 at 12:15, LaVey wrote:
> > hi there...
> >
> > I am having problems replacing the following string...
> >
> > string str_Content="The day is [so bad] for me";
> > str_Content = Regex.Replace(str_Content,"[so Bad]","[new replace
> > string]",RegexOptions.IgnoreCase);
> >
> > how do I replace my "[so bad]" to "[new replace string]"
> >
> > regards,
> > Nigil
> >
> --
> Philip Van Hoof, Software Developer @ Cronos
> home: me at freax dot org
> work: Philip dot VanHoof at cronos dot be
> http://www.freax.be, http://www.freax.eu.org
>
> _______________________________________________
> Mono-list maillist - Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list