in reply to Re: Parsing an Oracle connect string
in thread Parsing an Oracle connect string
Since I added the ability to surround the password in 'quotes', it unfortunately removed that bit from the '/' discovery. So that's now captured in $diag.10 $string =~ s/ *([@\/]) */$1/g; 11 my ($userid, $diag, $password, $netServiceName) = $string =~ / +'?([^@\/']+)?(?:(\/)'?([^@\/']*)'?)?(@[^@\/']+)?'?/;
@\/. This seems to parse ok in my test program:
Parses as:SYS / foo_pw @ stuff SYS / ' foo_pw1' @ stuff SYS /' foo_pw2' @ stuff SYS / foo sp ace @ stuff SYS/change_on_install@prod1 LAST rman/rman@rcat SYS / /fooey /fooey@foobar SYS@foobar 'simple/fooey@foobar'
(Note that my test program truncates some longer passwords in the printout.)< SYS> < /foo_pw> [ @stuff] < SYS> < / foo_pw1> [ @stuff] < SYS> < / foo_pw2> [ @stuff] < SYS> < /foo sp ace> [ @stuff] < SYS> </change_on_i> [ @prod1] < LAST> < > [ ] < rman> < /rman> [ @rcat] < SYS> < > [ ] < > < /> [ ] < > < /fooey> [ ] < > < /fooey> [ @foobar] < SYS> < > [ @foobar] < simple> < /fooey> [ @foobar]
|
|---|