You can use Patterns for example :

String str = "Niedersachsen,NOT IN CHARGE SINCE: 03.2009, CATEGORY";
Pattern p = Pattern.compile("\\d{2}\\.\\d{4}");
Matcher m = p.matcher(str);

if (m.find()) {
    System.out.println(m.group());
}

Output

03.2009

Note : if you want to get similar dates in all your String you can use while instead of if.


Edit

Or you can use :

String str = "Niedersachsen,NOT IN CHARGE SINCE: 03.03.2009, CATEGORY";
Pattern p = Pattern.compile("SINCE:(.*?)\\,");
Matcher m = p.matcher(str);

if (m.find()) {
    System.out.println(m.group(1).trim());
}
Answer from Youcef LAIDANI on Stack Overflow
🌐
W3Schools
w3schools.com › java › ref_string_substring.asp
Java String substring() Method
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&A ... The substring() method returns a substring from the string.
🌐
Baeldung
baeldung.com › home › java › java string › get substring from string in java
Get Substring from String in Java | Baeldung
July 21, 2024 - For more details on the Java regular expressions check out this tutorial. We can use the split method from the String class to extract a substring. Say we want to extract the first sentence from the example String.
🌐
GeeksforGeeks
geeksforgeeks.org › java › substring-in-java
Java String substring() Method - GeeksforGeeks
April 11, 2025 - In Java, the substring() method of the String class returns a substring from the given string.
🌐
BeginnersBook
beginnersbook.com › 2013 › 12 › java-string-substring-method-example
Java String substring() Method with examples
Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex – 1. Thus the length of the substring is endIndex-beginIndex. Examples: “hamburger”.substring(4, 8) returns “urge” “smiles”...
🌐
IONOS
ionos.com › digital guide › websites › web development › java substrings
How to use the Java substring method - IONOS
January 6, 2025 - Java’s substring method is used to extract a substring from a larger string.
🌐
How to do in Java
howtodoinjava.com › home › string › java string substring()
Java String substring() with Examples - HowToDoInJava
January 10, 2023 - String substring(int beginIndex) String substring​(int beginIndex, int endIndex) The method returns the substring between the valid start and end indices. If the indices are not valid then we can get IndexOutOfBoundsException error in the runtime.
🌐
Simplilearn
simplilearn.com › home › resources › software development › all you should know about substring in java
All You Should Know About Substring in Java | Simplilearn
September 11, 2025 - Syntax : public String substring(int startIndex, int endIndex) Parameters: startIndex: the starting index, inclusive ... Return Value: Specified substring. ... Want a Top Software Development Job?
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
Find elsewhere
🌐
Programiz
programiz.com › java-programming › library › string › substring
Java String substring() | Programiz
January 31, 2024 - The Java substring() method extracts a part of the string (substring) and returns it.
🌐
CodeGym
codegym.cc › java blog › strings in java › substring in java
Java String substring()
July 23, 2024 - Java Substring in general is a contiguous sequence of characters inside the String. It could be a part of the String or the whole String as well. What is substring in Java? This language has a substring() method, or rather two methods, thanks to Java method overloading. You may use them to get substring in Java program.
🌐
HappyCoders
happycoders.eu › home › java › java substring() method: how to use it and how it works
Java substring() Method: How to Use It and How It Works
1 month ago - Experienced Java developers familiar ... Work in Java?” section. The String.substring() method returns a substring of the original string, based on a beginning index and an ending index....
🌐
Tutorialspoint
tutorialspoint.com › java › lang › string_substring.htm
Java - String substring() Method
package com.tutorialspoint; public ... substring = This is tutorials point · Following is an example to show the use of substring() method in Java by finding the substring of the provided string....
🌐
Codecademy
codecademy.com › docs › java › strings › .substring()
Java | Strings | .substring() | Codecademy
April 28, 2025 - The .substring() method in Java returns a portion of a string from a specified starting index to an (optional) ending index.
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-string-substring
Master Java Substring Method: Examples, Syntax, and Use Cases | DigitalOcean
February 20, 2025 - Learn how to use the Java substring method. Explore syntax, practical examples, and common errors to handle substrings effectively.
🌐
JavaBeat
javabeat.net › use-string-substring-method-java
How to Use String substring() Method in Java
The substring() is a built-in method of Java’s standard String class. You can use/apply this method on any given string. As a result, it extracts and retrieves a substring(part of a string) according to the specified starting and ending indexes.
🌐
javathinking
javathinking.com › blog › get-substring-from-string-in-java
Get Substring from String in Java: A Comprehensive Guide — javathinking.com
String.substring() creates a new String that (in Java 7+) has its own character array. For very large strings, excessive substring operations can cause memory issues.
🌐
Vultr Docs
docs.vultr.com › java › standard library › java › lang › string › substring()
Java String substring() - Extract Substring | Vultr Docs
January 1, 2025 - The substring() method in Java is available in two variations, each serving to extract parts of a string based on different sets of parameters:
🌐
Baeldung
baeldung.com › home › java › java string › java string.substring()
Java.String.substring() | Baeldung
April 11, 2025 - @Test(expected = IndexOutOfBoundsException.class) public void whenSecondIndexEqualToLengthOfString_thenCorrect() { String s = "Welcome to Baeldung"; String sub = s.substring(0, 20); }