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

  • Home
  • SEARCH
  • 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 1058153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:58:50+00:00 2026-05-16T17:58:50+00:00

I have two strings that I need to pull data out of but can’t

  • 0

I have two strings that I need to pull data out of but can’t seem to get it working. I wish I knew regular expression but unfortunately I don’t. I have read some beginner tutorials but I can’t seem to find an expression that will do what I need.

Out of this first string delimited by the equal character, I need to skip the first 6 characters and grab the following 9 characters. After the equal character, I need to grab the first 4 characters which is a day and year. Lastly for this string, I need the remaining numbers which is a date in YYYYmmdd.

636014034657089=130719889904

The second string seems a little more difficult because the spaces between the characters differ but always seem to be delimited by at minimum, a single space. Sometimes, there are as many as 15 or 20 spaces separating the blocks of data.

Here are two different samples that show the space difference.

!!92519 C 01 M600200BLNBRN D55420090205M1O

!!95815      A               M511195BRNBRN            D62520070906  ":%/]Q2#0*&

The data that I need out of these last two strings are:

The zip code following the 2 exclamation marks.
The single letter 'M' following that. It always appears to be in a 13 character block
The 3 numbers after the single letter
The next 3 numbers which are the person's height
The following next 3 are the person's weight
The next 3 are eye color
The next block of 3 which are the person's hair color

The last block that I need data from:

I need to get the single letter which in the example appears to be a ‘D’.
Skip the next 3 numbers
The last and remaining 8 numbers which is a date in YYYYmmdd

If someone could help me resolve this, I’d be very grateful.

  • 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-05-16T17:58:51+00:00Added an answer on May 16, 2026 at 5:58 pm

    For the first string you can use this regular expression:

    ^[0-9]{6}([0-9]{9})=([0-9]{4})([0-9]{4})([0-9]{2})([0-9]{2})$
    

    Explanation:

    ^          Start of string/line
    [0-9]{6}   Match the first 6 digits
    ([0-9]{9}) Capture the next 9 digits
    =          Match an equals sign
    ([0-9]{4}) Capture the "day and year" (what format is this in?)
    ([0-9]{4}) Capture the year
    ([0-9]{2}) Capture the month
    ([0-9]{2}) Capture the date
    $          End of string/line
    

    For the second:

    ^!!([0-9]{5}) +.*? +M([0-9]{3})([0-9]{3})([A-Z]{3})([A-Z]{3}) +([A-Z])[0-9]{3}([0-9]{4})([0-9]{2})([0-9]{2})
    

    Rubular

    It works in a similar way to the first. You may need to adjust it slightly if your data is not exactly in the format that the regular expression expects. You might want to replace the .*? with something more precise but I’m not sure what because you haven’t described the format of the parts you are not interested in.

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

Sidebar

Related Questions

I have several strings that look like the following: +H124005992014011/1527399999999I05Z +H7039700000001/$99999999I051 +K122005962050171/120911234C117 I need
I have what seemed at first to be a trivial problem but turned out
I have two values coming in, a string in the form StartTime YYYY-MM-DD HH:MM:SS
I have a database of job descriptions, and I need to match these descriptions
Last week, we created a program that manages sets of strings, using classes and
I am using C#, I'm fairly new to the language but I have used
This is a JavaScript/Ajax webpage (also using jQuery). I have a nested structure I
I have some opaque bytes which I want to use in an std::map ,
I need to generate a unique hash code for an object, based on its
I was curious about how the MongoDB plugin for Grails would handle relationships. In

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.