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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:40:29+00:00 2026-06-14T07:40:29+00:00

What would be the regular expression to match a string with two underscores breaking

  • 0

What would be the regular expression to match a string with two underscores breaking up a 3 series of characters. This can also be a SQL ‘like’ statement if that is possible.

Match:

b_06/18/2012_06:02:34 PM 
y1289423_06/14/2011_03:06:35 AM 
23479693_11/01/2011_06:12:55 PM 

Not Match:

CCC Valuation_b_06/28/2012_05:57:20 PM 
CCC Valuation_CCC Valuation_b_06/28/2012_05:57:20 PM 
doc1_2.pdf 
testdoc.txt
  • 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-14T07:40:31+00:00Added an answer on June 14, 2026 at 7:40 am

    If all of the data is consistent with your examples, then this should work:

    EDIT: Updated to match the whole line. This will preclude any substring matches in the invalid list. However, it assumes that OP does not want to match any substrings.

    ^[a-z0-9]+_[0-9\/]+_[A-Z0-9:\s]+$
    

    For example, in python:

    >>> import re
    >>> s = 'b_06/18/2012_06:02:34 PM'
    >>> pattern = '^[a-z0-9]+_[0-9\/]+_[A-Z0-9:\s]+$'
    >>> m = re.match(pattern, s)
    >>> m.group(0)
    'b_06/18/2012_06:02:34 PM'            # <======== matches from valid list
    
    >>> s = 'CCC Valuation_CCC Valuation_b_06/28/2012_05:57:20 PM'
    >>> m = re.match(pattern, s)
    >>> m.group(0)
    Traceback (most recent call last):    # <======= does NOT match from invalid list
      File "<stdin>", line 1, in <module>
    AttributeError: 'NoneType' object has no attribute 'group'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to match URL string anything#1 in django. My regular expression goes
I would like to use a Perl regular expression to match strings like this:
I'd like a regular expression to match a string only if it contains a
How can I use a regular expression to match text that is between two
What would be the regular expression to match a facebook proxy email address of
what would be the regular expression to check if a given string contains atleast
I would like to have a regular expression which clears an HTML field when
I would like to create a regular expression that will replace a normal space
I would like to add a regular expression character dot . and such a
I would like to perform a regular expression in jQuery to find all the

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.