Hi All,
I am trying to search
string in a ArrayList of strings as we search a database with wildcards.
For example
Suppose Actual String is: - HTML is not enabled
Search query 1: %HTML%
Search query 2 : %TM% is not %nab%
Search query 3 : HTML is *o* (* and % both same (like wild card searches)
Search query 4 : HTML not enabled.
Of the above first 3 should give the result as true except the last.
I had tried the option of matches with regular expression, by adding (?i) at the starting of the string and replacing * or % with .* in the entire string. The problem i am facing now is that i am not able to do a replace of a special character (% or *) with another special character (.*).
I would like to know if there is any other better approach for this and also the solution for replacing a special character with another special character.
Thanks in Advance