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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:25:19+00:00 2026-06-16T09:25:19+00:00

I have 3 groups : time, date and pin. And i can have this

  • 0

I have 3 groups : time, date and pin. And i can have this line to match this lines :

26/06/2012 33:06:12a_user_logged_in,3412234,2,3,512,3
33:06:12a_user_logged_in,3412234,2,3,512,3,26/06/2012
26/06/2012 a_user_logged_in_at,33:06:12,3412234,2,3,512,3

I want to match 26/06/2012 as the date group, 33:06:12 as the time and 3412234 as the pin group.

I’ve succeeded in doing so but only the line must be in a certain pattern like the first one

(?<date>[\d]+/[\d]+/[\d]+) (?<time>[\d]+:[\d]+:[\d]+)([ |,][a-zA-z]*)+,(?<pin>[\d]{4,10}).+ 

But when i apply this pattern to the other two lines forms, it didn’t match.

My question is, how to match time, date and pin groups no matter what was the line form ?

  • 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-16T09:25:20+00:00Added an answer on June 16, 2026 at 9:25 am

    If you don’t want to validate the pattern at the same time, you can use lookaheads starting from the beginning of the string. Since they don’t actually consume anything, the engine jumps back to the start after completing one lookahead. Hence, the order of the three matches does not matter:

    ^(?=.*(?<date>\d+/\d+/\d+))(?=.*(?<time>\d+:\d+:\d+))(?=.*,(?<pin>\d{4,10}))
    

    Note the , in front of the pin group. Otherwise you risk that the year is found as the pin (since it is also 4 digits).

    But then again, for the sake of readability of your code you might want to just split that into three patterns (this also avoids capturing so it might not even be that much slower):

    Pattern for date: \d+/\d+/\d+
    Pattern for time: \d+:\d+:\d+
    Pattern for pin:  (?<=,)\d{4,10}
    

    These will simply give you your desired values as the entire match.

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

Sidebar

Related Questions

I have the following SQLFiddle , i can group the results by time, count
In my application I have groups which are essentially just tags that can be
I have a list of items that can be represented like this: ClientNo Name
In my java spring webapp I have relationship: One account can have many groups
I have a database table. First, I want to group by date time. Then
I am having problems with this MySql query: INSERT INTO groups (NAME, DESC, TIME,
I have a basic line graph with two lines. When I click a button,
I have a sales table that shows the date and time of each sale.
I have a table of fixtures in my DB: hometeam, awayteam, date, time I
OK I have this query that groups 2 columns together quite nicely: SELECT search_query_keyword,

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.