Hi
This time I don't know how to write regular expression to match :
String sql = "select * from user where username='" + username +"' and password='" + password + "'";
what I want exactly is:
1- match word select (ignore cases).
2-if that line match then save the variable name(which sql in my example above) save it in String test.
3-make another regular expression to match test (from step 2) into any other line.
Thanks
u can use compareToIgnoreCase() which is one of the method in String class
u can compare the username like this :
Is your match word select is to select word from the string sql ??Code:username.compareToIgnoreCase("whatever you want to compare");
what I mean is : I want regular expression to match any string that have word(select)
and then if this string matched, save this string name (mg)in variable for example (xxx).
after that make another regular expression to match that string name (mg) which we save it in xxx with any other string containing that name (mg)
use indexOf(String s) method of String class.
Thank you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks