I once built a program in php that used very specific regular expressions to match links, however that pattern doesnt seem to work in java, Im trying to find the java equivalent of
"~http://(bit.ly|t.co)~"
in php this would would match links such as http://t.co/UURRNlrK and http://bit.ly/AenG5W what would be a java equivalent of this?
I think you are looking for
Output =
http://t.co/UURRNlrKif
str = "http://bit.ly/AenG5W"Output =
http://bit.ly/AenG5WHere is a nice Regex Tutorial for java.