Problem with Regular Expression
Hu Guys!
I need some help with regular expression. I have to identify in an HTML code the following tag:
<username/>
However, i need to consider also the fact that after "<" there might be some blank characters, after "username" there might be the same situation, same thing for "/". So the situation is the following:
"<" zero or more spaces "username" zero or more spaces "/" zero or more spaces ">"
Now, I do not want the solution, but some hint to get that.
Thanks,
Luca
Re: Problem with Regular Expression
Maybe something like this:
^[<] \s* [username] \s* [\] \s* $[>]
??
Re: Problem with Regular Expression
Solved...here the solution
String regex = "<+\\s*+username+\\s*+/+\\s*+>";