I need to grab the value of password from db connection string using regex.
This is my current regex .*;(?i)Password=([^;]*)
.
This works only if there is not any ;
character in password.
add key="myKey" value="Data Source=MyDataSource;Initial Catalog=MyDB;User ID=test-user;Password=pA&-pass; unicode=True"
But it fails if there is ;
character in password
add key="myKey" value="Data Source=MyDataSource;Initial Catalog=MyDB;User ID=test-user;Password=pass>; unicode=True"