Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO table_name (c1,c2,c3) VALUES ('',N'user','','1970-01-01 00:00:00.0')
- table_name
- c1,c2,c3
- '',N'user','','1970-01-01 00:00:00.0'
- final String regex = "((?<=(INSERT\sINTO\s))[\w\d_]+(?=\s+))|((?<=\()([\w\d_,]*|[N?'?.*\s?.*'?,]*)+(?=\)))";
- table_name
- c1,c2,c3
- '',N'user',''
- final String regex = "((?<=(INSERT\sINTO\s))[\w\d_]+(?=\s+))|((?<=\()([\w\d_,]*|[N?'?.*\s?.*'?,]*)+(?=\)))";
- String test = "INSERT INTO table_name (c1,c2,c3) VALUES ('',N'user','','1970-01-01 00:00:00.0')";
- Pattern re = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
- Matcher m = re.matcher(test);
- while (m.find())
- {
- System.out.println(m.group(0));
- }
Add Comment
Please, Sign In to add comment