RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?<entryname>[\w_0-9]+)\s*=\s+\(\s*DESCRIPTION\s*=\s+\(\s*ADDRESS_LIST\s*=\s+\(\s*ADDRESS\s*=\s*\(\s*PROTOCOL\s*=\s*(?<protocol>\w+)\)\s*\(\s*HOST\s*=\s*(?<host>[^\)]+)\)\s*\(\s*PORT\s*=\s*(?<port>\d+)\s*\)\s*\)\s+\)\s+\(\s*CONNECT_DATA\s*=\s+\(\s*SERVICE_NAME\s*=\s*(?<svcname>\w+)\s*\)\s+\)\s+\)
Description
This regex is designed to parse entries from tnsnames.ora for Oracle connections. This is a crude first cut in that it doesn't allow for multiple ADDRESS entries in the ADDRESS_LIST section, and I don't know if there are other attributes that I should be allowing for. Basically, I just don't know enough about possible scenarios at this time, so I just wrote it to what I see in the wild where I work.
Matches
D007DEVL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ddt210)(PORT =
Non-Matches
Anything that is not a tnsnames.ora entry
Author Rating: Not yet rated. Charles Farley
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials