Last active
October 21, 2019 11:37
-
-
Save cenkc/f1d4f26d9ab068375d0c3e8324b3643f to your computer and use it in GitHub Desktop.
regex case-insensitive search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
// regex case-insensitive search (?i:SOME_STRING) | |
String hede = "http://127.0.0.1:8888/SomeWS/SomeWSEndpointService?wSdL"; | |
String hodo = hede.replaceFirst("(?i:\\?wsdl)", "?wsdl"); | |
System.out.println("hede = " + hede); | |
System.out.println("hodo = " + hodo); | |
} | |
//hede = http://127.0.0.1:8888/SomeWS/SomeWSEndpointService?wSdL | |
//hodo = http://127.0.0.1:8888/SomeWS/SomeWSEndpointService?wsdl | |
// Credit: | |
// https://alvinalexander.com/blog/post/java/java-how-case-insensitive-search-string-matches-method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment