[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-list
Subject:    Re: [Mono-list] Regex dosen't recognize \s or \w ?
From:       IBBoard <ibboard () gmail ! com>
Date:       2015-02-04 18:55:51
Message-ID: 54D26B37.8070902 () gmail ! com
[Download RAW message or body]

That'd cover "zero or more spaces", but wouldn't cover "zero or more
whitespace characters" (which is what "\s" would get you, and what I'm
assuming OP really wants, despite not *quite* being what they said in
their final quesion).

Do any escape characters work or is it just those? Don't forget that
regex escapes like \s are different to character escapes like \r, \n and
\t - you need to escape the backslash if you're using it in
double-quoted strings, or else it will be treated like a character
escape, not a special regex escape.

See the example at
https://msdn.microsoft.com/en-us/library/ms228595.aspx#code-snippet-2
for what I mean.



On 04/02/15 18:49, Agustin Gimenez wrote:
> Not sure if that's a bug or not, but you can perfectly use " *?" to
> search for zero or more spaces (I always try to use lazy search when
> possible, if that's not your case remove the question mark after star),
> I have put that inside quotes to denote the space before the star.
> 
> Cheers.
> 
> 2015-02-04 16:03 GMT+01:00 mickeyf <mickey@thesweetoasis.com
> <mailto:mickey@thesweetoasis.com>>:
> 
>     I am using Monodevelop 3.0.3.2,  with mono runtime 2.10.8.1 on
>     Ubuntu 12.04
> 
>     When I try to include \s or \w in my regex, I get 'Unrecognized escape
>     sequence', Otherwise regex works as I'd expect. (But I freely admit to
>     having limited experience with regex.)
> 
>     What have I missed? Or if \s is not available, how do I specify "zero or
>     more spaces" ?
> 
> 
> 
>     --
>     View this message in context:
>     http://mono.1490590.n4.nabble.com/Regex-dosen-t-recognize-s-or-w-tp4665410.html
>     Sent from the Mono - General mailing list archive at Nabble.com.
>     _______________________________________________
>     Mono-list maillist  -  Mono-list@lists.ximian.com
>     <mailto:Mono-list@lists.ximian.com>
>     http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic