如何编写正则表达式以从连接字符串中检索密码。
连接字符串是这样的:
USER ID=system;PASSWORD = ab;DATA ..
或者
USER ID=system;PASSWORD=ab;DATA ...
或者
USER ID=system;PASSWORD =ab;DATA...
或者
USER ID=system;PASSWORD= ab;DATA ...
尝试了使用 ConnectionStringBuilder 的方法。适用于 SQL Server。但在 Oracle 的情况下,它会抛出此异常:
Invalid length for connection option 'Data Source', maximum length is 128.
Oracle 连接字符串:
USER ID=sa;PASSWORD=abc;DATA SOURCE="(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 8080))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = Orcl)))"