Re: As I can determining if string can be turned to a numerico value?

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



I tend to do most of my work in Perl, so regex and parsing is second nature,
the scripts are small and the speed of execution (of my scripts) is usually
across a network to end hosts, so that is usually the performance bottle
neck and not the code performance. The cost effective was just a flippant
remark and the code posted did not speak to the exact issue the poster
asked. I figured sample code or suggestions would be more appropriate then
giving the solution so the poster can use what works best for them or that
with which they are familiar. I will be more accurate in the future.



Thanks for the time trials that was interesting to see those results.



What I like about the discussion groups is that users of various levels can
get insight into different solutions and the background of those solutions.
I posted some solutions that were criticized and then posted the VB DLL as
that is where I first ran across IsNumeric.



Thanks for your input Jon!



Denis


"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:1136999161.933529.39320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Denis Dougall wrote:
> > Using Regular expressions is the most cost effective way.
>
> What exactly due you mean by "cost effective" here? It certainly isn't
> the cheapest way of working - it's fairly easy to write a hard-coded
> check which is many times quicker than a regular expression.
>
> Using a regular expression is more efficient than using a try/catch,
> but arguably harder to read/debug. (It depends on your level of regex
> ability.)
>
> Jon
>


.



Relevant Pages

  • Re: Regular expressions
    ... if you are looking for Regular Expression help check out: ... RegEx Tutorial for VB: ... Sign the petition to Microsoft. ... >> newsgroups devoted exclusively to .NET programming. ...
    (microsoft.public.vb.syntax)
  • Re: Page.Invalid
    ... The regular expression validator compares the contents of your textbox against a regular expression (regex) If you haven't typed in the regular expression the validator is always going to return true. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Basic pattern matching - baffled
    ... $a is not used as a regex, it is treated as a literal string. ... The regular expression is on the right, what your testing is on the left: ... # numbers that can be matched in that single character position. ... the regular expression needs to escape '\' the escape character. ...
    (comp.lang.perl.misc)
  • RE: Cisco IPS 5.1
    ... Cisco IPS signature. ... URI Regex: Regular expression to search in the URI field. ... Regular expression to search in the HTTP arguments ...
    (Focus-IDS)
  • Re: Extracting a Regex--Multiple Times Per Line?
    ... occur multiple times in each line; ... All the versions of extract scripts I've been ... function extract_line(line, regex, field) ...
    (comp.lang.awk)