Re: Regular Experssion

From: Nick Malik (nickmalik_at_hotmail.nospam.com)
Date: 08/17/04


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
>
>



Relevant Pages

  • Re: Fastest way to search a string for the occurance of a word??
    ... but the OP's question was what's the "Fastest way to search a string ... in all the tests I did here, the Regex was by far superior. ... However, of course, if you've got new regular expressions all ... Sure - but just that extra Match object could be relevant if the search ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Search for multiple things in a string
    ... >>> As far as readability, it has nothing to do with Regular Expressions ... > and Regex. ... >> characters in the string, perhaps even writing your own state machine ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: String.replaceAll wont work :s
    ... the String#replaceAllmethod expects a regular expression (regex) ... function (just like in java Strings). ... The second parameter is no regex, but only the String which ... For more information about regular expressions, ...
    (comp.lang.java.help)
  • Re: regex test failing in form validation
    ... If you have debug on you'll see a decent report of what the code is ... The regex for matching correct protocol and TLD for the URL ... This will search for the string "TLDlist". ... neither in strings nor regular expressions. ...
    (comp.lang.javascript)
  • Re: Regular Experssion
    ... that regular expressions are so powerful, how come Cor was able to whip up a ... didn't whip up a regex example to show how much faster and cooler regex is? ... <flame off> ... especially if search and match string are long. ...
    (microsoft.public.vstudio.general)

Loading