Re: Extracting first 1 or 2 nymbers

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



John -

Good catch! Had me scratching my head for a while until I realized the
string(s) in question were being interpreted as scientific notation. Am
going to have to brush-up on regular expressions.

Best wishes - Bob

John Nurick wrote:
Hi Bob and Steve,

This will work most of the time but will give unexpected results if the
string starts with digits, then has a letter d or e (or D or E), and
then one or more digits:

? Val("56D5")
5600000

One (of many) alternatives is to use a regular expression, e.g. with the
rgxExtract() function at
http://www.j.nurick.dial.pipex.com/Code/index.htm

?rgxextract("56D5", "^\d+")
56


Hi Steve -

[quoted text clipped - 14 lines]

thanks for any and all help

--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200703/1

.



Relevant Pages

  • Documentation of Implicit Functionality
    ... Hi John. ... I've just answered a private question ... Where else does Perl implicitly use regular expressions? ... Rob ...
    (perl.beginners)
  • Re: Preserve trailing spaces in a textbox
    ... Life, work ... John Nurick has some examples of using Regular Expressions in VBA at the ...
    (microsoft.public.access.formscoding)
  • Re: Using constants in regular expressions
    ... > which does not allow any programming stuff. ... to one involving regular expressions, perhaps the Java Programmer group is ... better luck asking your question on a Perl newsgroup. ... John McGrath ...
    (comp.lang.java.programmer)
  • Re: pulling out Numbers
    ... I'm only on my 4th read of John Walkenbach's 2003 bible so perhaps some way ... Regular expressions are extremely powerful tools for string manipulation. ...
    (microsoft.public.excel.misc)
  • Re: Access to Excel
    ... transfers text to other excel cells and also to my access table? ... "John Nurick" wrote: ... the name to simply be inserted in a cell named name in excel. ...
    (microsoft.public.access.externaldata)