I am using the current expression to convert plain text hyperlink like with http or https to html hyperlinks
String pattern = "(?:https|http)://([^\\s\\|]+)";
However in the message content that will go through this regular expression pattern i have content like http://www.yahoo.com.
For this kind of content in between the two video brackets. I do not want it to be converted to html hyperlink because it will be displayed on the page.
How to resolve this issue?
Use negative lookahead and lookbehind using
(?<!...)and(?!...):Outputs:
Full example:
Outputs: