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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:48:06+00:00 2026-05-28T03:48:06+00:00

Need some regex help in Java. I have a string, which contains text and

  • 0

Need some regex help in Java. I have a string, which contains text and always a date after it. Then after the date, without a space, a new text starts and ends with a date. and so on and on and on. I need to get all the text instances out with loop. It needs to exclude date from the beginning and expect date in the end. Could anyone suggest a good regex for it?

String candidateString = "dffsd fs sfd 12.12.12asd saddsa dasd 12.12.12fsadf sdfsdf sdf 10.10.10";
Pattern p2 = Pattern.compile(".*?(?![0-9][0-9].[0-9][0-9].[0-9][0-9])[a-zA-Z] (?=[0-9][0-9].[0-9][0-9].[0-9][0-9])");
Matcher matcher2 = p2.matcher(candidateString);
while (matcher2.find()) {
  System.out.println(matcher2.group());
}

This code expects date in the end, but I can’t figure out how to exclude date from the beginning.

  • 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-28T03:48:07+00:00Added an answer on May 28, 2026 at 3:48 am

    See if this is what you want?

        String candidateString =
            "Microsoft Visual FoxPro 6.0 language reference 13.02.12";
            //"dffsd fs sfd 12.12.12asd saddsa dasd 12.12.12fsadf sdfsdf sdf 10.10.10";
    
        Pattern p2 =
            Pattern
                .compile("(.*?(?![0-9][0-9]\\.[0-9][0-9]\\.[0-9][0-9])) ([0-9][0-9]\\.[0-9][0-9]\\.[0-9][0-9])");
    
        Matcher matcher2 = p2.matcher(candidateString);
    
        while (matcher2.find()) {
            System.out.println("String: |" + matcher2.group(1) + "| Date: |"
                + matcher2.group(2) + "|");
        }
    

    This prints the below for me (Have included | [pipes] to show the boundaries).

    String: |dffsd fs sfd| Date: |12.12.12|
    String: |asd saddsa dasd| Date: |12.12.12|
    String: |fsadf sdfsdf sdf| Date: |10.10.10|
    

    and

    String: |Microsoft Visual FoxPro 6.0 language reference| Date: |13.02.12|
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need some help from a regex jedi master: If I have a string of
I'm not so good with regex, and need some help. I have a string
I'm developing in Java and I have a long string of text which contains
I need a little help with some regex I have. Basically I have a
I need some help. I have many rows in my text file with this
I need some help with javascript and regex.I want to remove some text in
I need some help with RegEx. I have a URL: ../../temporary/12357704$002cXX$002c302036261/-1;jsessionid=13817F357AB3CD30E0836AA89903A003 or ../../temporary/12337704$002cXX$002c30222261/-1;jsessionid=13817F357AB3CD30E0836AA89903A003 I
I need some help. I am looking for a regex that would match the
I need some help about RegExp in AS3. I have a simple pattern :
Need some help about with Memcache. I have created a class and want to

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.