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 516021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:41:20+00:00 2026-05-13T07:41:20+00:00

Hi I have a difficult regex problem that I have tried and have a

  • 0

Hi I have a difficult regex problem that I have tried and have a partial solution, but haven’t gotten to work perfectly yet. Essentially, I have to parse a document that is in an outline format such as this:

1. HEY BUDDY
1.A. Your the best
1.A.1 And i know
1.A.2. this because
1.A.3 it is
1.A.4. the 
1.A.5. truth i 
1.A.6. tell ya.
1.B. so anyway
1.B.1. one two 
1.B.2 three four!
2. i have 
2.A. many numbers 
2.A.1. hahaha
2.A.1.A. 3.2 ppl
2.A.1.B. are in
2.A.1.C my head.
2.A.1.D. yes exactly
2.A.2. 3.21
2.A.3. if you dont
2.A.4 trust me
2.B then 
2.B.1. youre 
2.B.2.soo wrong
2.C. its not
3. even funny.
3.A. but it
3.B. kind of 
3.C. is a little 
4. bit i 
4.A. believe.
4.A.1. talk to me
4.A.2. more about 
4.B. these ppl
4.B.2. in your head.

That is my test document… I need to find each of the new “bullets” in this document and then save the text in between them and do more computation. All that I haven’t figured out is how to acurately identify the different outline numbers using regex. (I know it could probably be done other ways then regex but I’m in the process of learning regex and I have my mind set on doing it this way) What I’ve come up with now is this:

(\b)(([1-9][0-9]?)(\.))([A-Z])?((\.)([1-9][0-9]?)((\.)([A-Z]))?)*(\.)?(\b)

The problem with this is that it isn’t recognizing the 1., 2., 3., or 4., and it IS picking up “3.” from the 3.2 and 3.21 in the text. (And yes i will have doubles in the text like this) The format for the outline is always #.A-Z.#.A-Z.#.A-Z… and numbers should never be higher then 99.

Thanks for any help.

  • 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-13T07:41:21+00:00Added an answer on May 13, 2026 at 7:41 am
    ^[\d\w\.]+ [^\n]+$
    

    explaining: “start of line: any digit+character+dot combination, followed by space and a combination of any non-line break character:end of line”

    Have in mind that you will need to add another slash when you write this regex in your code.

    The Pattern class documentation is extremely useful, even if you are advanced with regex.

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

Sidebar

Related Questions

No related questions found

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.