Hi all,
I am trying to create a regular expression that would separate the rest of the text from smileys.
For example if the input text is
"Hello:)World:(Hello"
Then I should get the output as an array of strings as
{"Hello","World","Hello"}.
I figured out a way to do this would be to create Pattern and then use the split method on it as follows:
String str[];
Pattern p=Pattern.compile(":)");
str=p.split("Hello:)World:(Hello")
However I am getting the following error:
Exception in thread "main" java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 0
How do I represent the opening parenthesis in a regular expression?
Also can I represent a combination of smileys in the regular expression?
Please help.
Any inputs on this would be appreciated.