fbicknel has asked for the wisdom of the Perl Monks concerning the following question:
Fun stuff.
Say you have an oracle connect string that looks like:
I humbly ask your opinions:
>>string<< is parsed as <userid> </password> <@net_service_name>
Note, btw, the special case of '/' which needs to parse as simply '/'.
Say you have an oracle connect string that looks like:
Now say you want to parse that. I came up with this regex that seems to do it, at least for some of the simple tests below.['] [userid] [/ [password]] [@net_service_name] [']
I humbly ask your opinions:
Samples.my ($userid, $password, $netServiceName) = /'?([^@\/']+)?(\/[^@\/']*)? +(@[^@\/']+)?'?/;
>>string<< is parsed as <userid> </password> <@net_service_name>
Note, btw, the special case of '/' which needs to parse as simply '/'.
>>SYS/change_on_install@prod1<< <SYS> </change_on_install> <@prod1> >>rman/rman@rcat<< <rman> </rman> <@rcat> >>SYS<< <SYS> <> <> >>/<< <> </> <> >>/fooey<< <> </fooey> <> >>/fooey@foobar<< <> </fooey> <@foobar> >>SYS@foobar<< <SYS> <> <@foobar> >>'simple/fooey@foobar'<< <simple> </fooey> <@foobar>
Back to
Seekers of Perl Wisdom