I am in a situation where I need to grab the password value from configuration setting using regex.
actually I am using third party solution (cyberark password management) what it does is grab the password from config file and change the password.
To let cpm knows where is password in config file , I do some setting where I need to provide regex expression.
Working regex:
.*;Password=(.*)
Above regex works fine where configuration setting is like
value="Data Source=MyServer;Initial Catalog=MyDb;User ID=MeTestUser;Password=xyz123"
But it does not work for :
value="Data Source=MtTest.WORLD;Persist Security Info=True;User ID=MeTestApp;Password=abc123;Unicode=True"
For such case I provide
.*;Password=(.*;)
and still It does not work .
I need to make sure it only takes password value before semi-colon.
Note. CPM solution knows that its config file and so when it parse to get the value and change it looks for data between quotation.
What I have tried:
I tried
<pre>.*;Password=(.*;)
this regex expression but it did not work.