I am framing a regex to check if a word starts with http:// or https:// or ftp://, my code is as follows,
http://
https://
ftp://
public
If you wanna do it in case-insensitive way, this is better:
System.out.println(test.matches("^(?i)(https?|ftp)://.*$"));