Results 1 to 4 of 4

Verify A String Segment As Number using Reg Expression

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Verify A String Segment As Number using Reg Expression

    Hi all,

    I have a string value similiar to the following:

    S = "01,1,1,AVG,200-OEG~"

    I'm interested in checking only the value before the first comma.

    I have no problems parsing this value out.

    So, continuing, the parsed value in this case would be "01".

    T = 01 , where T is a String Value.

    Using Regular expression, I'd like to verify the value is a number or integer.

    I've tried the following expressions, but none are recognizing the value as a number.
    
    T = 01
    
         If Trim(T) Like "^[1-9][0-9]*$" Then
            MsgBox T
              End If
    
    
                      If Trim(T) Like "[\d][\d]" Then
            MsgBox T
    
            End If
    Both, I would think should work. I'd prefer to use the first expression to catch any numerical size.

    Any help to resolve is appreciated

    Thanks,

    BDB
    Last edited by bdb1974; 04-01-2011 at 05:29 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1