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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:02:29+00:00 2026-05-14T01:02:29+00:00

Can anybody help me with retrieving some elements from the following example text: sdfaasdflj

  • 0

Can anybody help me with retrieving some elements from the following example text:

sdfaasdflj asdfjl;a 
AB-12/34 BC-/85 CD-//8 DD-77
DE-78/9
EE-78-98
asdf; asdjf

It is necessary to get the following elements:
AB-12/34, BC-/85, CD-//8, DD-77, DE-78/9

When I’m using a regular expression like this:

\s*(?<elements>\b[A-Z]{2}-[/0-9]+\b)

everything works fine – all the necessary elements are being retrieved (except for the EE element are amonth them, but it doesn’t matter).
The problem is that this line is a part of a more complex regex, so when I’m trying to apply a regex like this:

(?s).*\sas.*?
\s*(?<elements>\b[A-Z]{2}-[/0-9]+\b)*.*
.*as

It only returns me just the first AB-12/34 element and nothing else.
How to correct the regex to get all the elements? TIA.

  • 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-14T01:02:30+00:00Added an answer on May 14, 2026 at 1:02 am

    To match the block "(?<elements>\b[A-Z]{2}-[/0-9]+\b)*" multiple times in your example, you need to include the whitespace in it. I.e.:

    "(?<elements>\s*\b[A-Z]{2}-[/0-9]+\b)*"
    

    If you do not want to capture it, try ""(?:\s*(?<elements>\b[A-Z]{2}-[/0-9]+\b))*". I am not sure how the named capture group, inside a non-capturing group will work, though. =)

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

Sidebar

Related Questions

Can anybody help with converting an SDL_Surface object, a texture loaded from a file,
Can anybody help or point me in the right direction for a tutorial/example for
can anybody help me with this ? I have added some custom fields to
Can anybody help me to form a regular expression to search the following string:
Can anybody help(or point to some examples) about how to encrypt files with python?
Can anybody help, I`m starter in web? Here is code: <head> <meta http-equiv=Content-Type content=text/html;
Can anybody help me to find out solution of following problem. In ASP.NET website:
Can anybody help me letting me know what is wrong with the following code?
Can anybody help me with this: I want select all records from datatable which
Can anybody help me with Text to Speech Engine in C#

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.