Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / December 2005

Tip: Looking for answers? Try searching our database.

is this regular expression bug?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
baibaichen - 30 Dec 2005 06:02 GMT
hi,
in vs.net 2003, i want to use colo(u{1}r|r) to search colour or color,
but it only matchs colour!

1) if i use colo(u{1}r|a), it will match colour or coloua.
2) if i use colo(ur|r), it will match color or colour.

it seems that something different between only literal expression and
expression with meta-charactor!

it raises my eyebrow!  what's reason?

thanks
Jon Shemitz - 30 Dec 2005 08:52 GMT
> in vs.net 2003, i want to use colo(u{1}r|r) to search colour or color,
> but it only matchs colour!
>
> 1) if i use colo(u{1}r|a), it will match colour or coloua.

No, actually it will match "coloa", not "coloua".

> 2) if i use colo(ur|r), it will match color or colour.
>
> it seems that something different between only literal expression and
> expression with meta-charactor!

No. "u{1}" means 'one and only one u" - it's exactly the same as "u".

What you really want to match is either

 coloru{0,1}r

or just

 colou?r

Signature

    <http://www.midnightbeach.com>

chenchang - 30 Dec 2005 09:00 GMT
coloru{0,1} and colou?r are both useless in the vs.net ide

> > in vs.net 2003, i want to use colo(u{1}r|r) to search colour or color,
> > but it only matchs colour!
[quoted text clipped - 17 lines]
>
>   colou?r
Jon Shemitz - 30 Dec 2005 19:57 GMT
> coloru{0,1} and colou?r are both useless in the vs.net ide

Yes, I noticed after I started checking the regex that this was the
ide group, and that you said "in vs.net 2003" - but I wasn't sure if
you really meant IDE regexs, or were just being lame. (One sees so
much of the latter.)

Sorry, can't help you with IDE regexs. I do wonder why they don't just
use the real, FCL Regex ....

> > > in vs.net 2003, i want to use colo(u{1}r|r) to search colour or color,
> > > but it only matchs colour!
[quoted text clipped - 17 lines]
> >
> >   colou?r

Signature

    <http://www.midnightbeach.com>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.