Re: Regular Experssion
From: Nick Malik (nickmalik_at_hotmail.nospam.com)
Date: 08/17/04
- Next message: Sijin Joseph: "Re: PrivateBinPath"
- Previous message: Sijin Joseph: "Re: looking for sample:multiple view single document in C# or VB"
- In reply to: Niki Estner: "Re: Regular Experssion"
- Next in thread: Niki Estner: "Re: Regular Experssion"
- Reply: Niki Estner: "Re: Regular Experssion"
- Reply: Cor Ligthert: "Re: Regular Experssion"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 17 Aug 2004 14:48:08 GMT
<flame on>
Honestly, Niki,
The world isn't made up of just two kinds of people:
people who do things your way, and people who are wrong.
Cor's solution was simple and easy to follow. It works just fine for the
specific purpose, and it far easier to debug than a regular expression,
which is difficult for most folks to compose (to the point where there's a
number of non-trivial tools running around to allow folks to debug their
regular expressions).
On technical points, you are right. However, your tone is condescending and
your contribution to the thread did not add any useful content. If you feel
that regular expressions are so powerful, how come Cor was able to whip up a
code example in the two minutes it took him to answer the post, but you
didn't whip up a regex example to show how much faster and cooler regex is?
I'll venture a guess to my own question: Perhaps this is because Cor's
example is so much simpler than a regex, which would require embedded
expressions, would be fairly difficult for a novice to code, and nearly
impossible to explain in a newsgroup post.
At least Cor answered the question.
<flame off>
Respectfully and in the spirit of constructive criticism,
--- Nick Malik
Application Architect
"Niki Estner" <niki.estner@cube.net> wrote in message
news:euGZLLFhEHA.3388@TK2MSFTNGP09.phx.gbl...
> "Cor Ligthert" <notfirstname@planet.nl> wrote in
> news:edlkREFhEHA.3964@TK2MSFTNGP12.phx.gbl...
> > Toby,
> >
> > I do not like the regex, I find it complicated and thereby it is very
> slow.
>
> Actually it's pretty fast, especially if search and match string are long.
>
> > You got an answer from Jared, however as alternative I give you this.
> >
> > \\\
> > Dim myStr As String = "MY_STRING_TO_BE_CONVERTED"
> > Dim myArr() As String = myStr.Split("_"c)
> > For i As Integer = 0 To myArr.Length - 1
> > myArr(i) = StrConv(myArr(i), VbStrConv.ProperCase)
> > Next
> > MessageBox.Show(String.Join("", myArr))
> > ///
>
> This is probably the slowest alternative...
> Use a StringBuilder if you want to do complex string maniplations.
>
> > With that I do not say you should not use the regex, however most
> situations
> > can be done with easier commands, which show more what you are doing in
> the
> > program.
>
> Only for people who don't know regex's, that is...
>
> Niki
>
>
- Next message: Sijin Joseph: "Re: PrivateBinPath"
- Previous message: Sijin Joseph: "Re: looking for sample:multiple view single document in C# or VB"
- In reply to: Niki Estner: "Re: Regular Experssion"
- Next in thread: Niki Estner: "Re: Regular Experssion"
- Reply: Niki Estner: "Re: Regular Experssion"
- Reply: Cor Ligthert: "Re: Regular Experssion"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|