Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- public class RegexTest {
- public static void main(String[] args) {
- String query = "select c.concept, a.name as applicationName, a.application_type_id as typefrom application_organization ao inner join application a on a.id = ao.application_id inner join category c on c.id = ao.category_idwhere ao.organization_id = :organization_id and ao.last_collected_date >= CAST( :initial_date as date ) {{#category_id}} and ao.category_id <> :category_id {{/category_id}} {{#applications}} and a.name in :applications {{/applications}}";
- Pattern compiled = java.util.regex.Pattern.compile("\\{\\{#([A-Za-z_]+)\\}\\}", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
- Matcher matcher = compiled.matcher(query);
- while (matcher.find()) {
- String group = matcher.group(1);
- System.out.println(group);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement