What will be the regular expression forbelow jdbc urls to find the databaseName. Output will be "ab_cd_e".
String jdbcUrl="jdbc:sqlserver://abc.com:1440;instanceName=MSSQLSERVER2019;integratedSecurity=false;databaseName=ab_cd_e";
String jdbcUrl="jdbc:sqlserver://abc.com:1440;instanceName=MSSQLSERVER2019;databaseName=ab_cd_e;integratedSecurity=false";
I have tried:
Pattern pattern = Pattern.compile("^(;databaseName=)(.*?)([;])", Pattern.CASE_INSENSITIVE);