Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9211657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:20:51+00:00 2026-06-18T01:20:51+00:00

I need to pull the first 3 to 13 characters out of a string,

  • 0

I need to pull the first 3 to 13 characters out of a string, starting at the beginning of the line and ending at the first encounter of whitespace.

The following code I cannot get to work. I often get an “Invalid Procedure” error. Changing the pattern sometimes makes the error go away, but it never results in the match that I need.

Please Help.

EDIT: I found this pattern “/[^ ]*/” which should do what I want (I think), but now when I execute the code I get an error at line strOut = match.SubMatches(0). Any idea why?

    ' Set the pattern to find the data we would like to test; 
re_Name.Pattern = "^xe\-1/1/1"
re_Name.IgnoreCase = True
re_Name.Multiline = True

vLines = Split(strNames, vbcrlf)
For Each strLine in vLines
Set matches = re_Name.Execute(strLine)
    For Each match in matches
        strOut = match.SubMatches(0)
        MsgBox strOut
        Next
    Next

Examples of what I am searching for:

xe-0/1/1
xe-0/3/2.0
ge-11/2/1
ae0
ae0.3156

Example of what it might like in context:

xe-0/0/0        up    up   xxxxxxxxxxJxx0/0xToxBBxxx1 x;
ae0.202         up    up   ;xxxxxx1;xxxxxxxxixxxxx 
ge-11/3/0.0     up    down Rxxxxxxx RESERVEDing
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:20:52+00:00Added an answer on June 18, 2026 at 1:20 am

    I think strOut = match.SubMatches(0) should be strOut = match.Value as you’re not capturing any submatches because you’re not using brackets to capture anything.

    If you just want to match characters up to the first space you could use

     re_Name.Pattern = "^\S+"
    

    \S matchs any non-space character.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to convert some strings, and pull out the two first integers e.g:
From a string, I need to pull out groups that match a given pattern.
I need to pull out the records whose First name,lastname and date of birth
I am faced with the need to pull out the information in a string
I have the following tables: http://www.gulllakeschools.net/mysqltables.pdf I need to pull the data out in
I need to pull out the content out of two paragraph tags and break
I have been given some poorly formatted data and need to pull numbers out
I need to pull a variable out of a URL or get an empty
Scenario: I need to pull information out of a Visual FoxPro database; however, running
I have taps installed. I get the following error. This is my first pull

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.