Re: A little help with regular expressions

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for the responses Kevin and Jon,
I wanted to do some benchmarking to see how fast I could get the regex to work. It's always nice to be able to compare different solutions to a problem before settling with one.
I'm using it in a HttpModule to redirect urls, so I want it to be as fast as possible.
I'm gonna run some benchmarks on the solution I have and see how I can optimize it.

Best regards,
Mats Lycken

Kevin Yu [MSFT] wrote:
Hi Mats,

I agree with Larry that using IndexOf in String class is enough in this scenario. Also, you don't need to worry about the performance for it. I think it'll be faster than RegEx, because it will parse the whole string according to RegEx schema, which makes it slower.

Kevin Yu
Microsoft Online Community Support

============================================================================
==========================
When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ============================================================================
==========================

(This posting is provided "AS IS", with no warranties, and confers no rights.)

.



Relevant Pages

  • Re: How to find regex at specific location on line
    ... > code inside single quotes while the suggested benchmarking script uses ... > it is best to only tests two to three code segments within one benchmark. ... > The anonymous subroutines proved to be very costly and produce totally ... It appears that the simplest regex perfomed best. ...
    (perl.beginners)
  • Re: problem with stat?
    ... Mathew schreef: ... I'm assuming that this regex would be faster, too, since it ... does not contain an alternation. ... That is hard to say without actual benchmarking: ...
    (perl.beginners)
  • Re: problem with stat?
    ... I'm assuming that this regex would be faster, too, since it ... does not contain an alternation. ... That is hard to say without actual benchmarking: ... looking for a file with exactly two dots? ...
    (perl.beginners)
  • RE: Complex Array Regex
    ... Kevin Old wrote: ... > this type of regex to learn more about them. ... > Here is the value that $cookies is set to. ... > It seems to be looping through each cookie, even though it's a string. ...
    (perl.beginners)
  • Re: Regular expression
    ... The reason I wanted to use Regular expressions was merely to learn more ... I agree that the String class can be used but I wondered how ... Regex could be used. ...
    (microsoft.public.dotnet.languages.vb)