hi i am trying to get digits inside brackes from file , whose structure is defined below
CREATE TABLE TELM
(SOC_NO CHAR (3) NOT NULL,
TXN_AMOUNT NUMBER (17,3)
SIGN_ON_TIME CHAR (8)
TELLER_APP_LIMIT NUMBER (17,3)
FIL01 CHAR (11)
CONSTRAINT TELMPK
PRIMARY KEY (SOC_NO,
TELLER_NO),
CONSTRAINT TELMUK_02
UNIQUE (SOC_NO,
TELLER_NO,
SUP_TELLER));
i want only digits inside bracket i am able to get digits from bracket (which is BOLD) if there is only one digit eg :
[(SOC_NO CHAR (3) NOT NULL,]
with following code
if (/^.*(CHAR|NUMBER)\s*.*$/) {
$_ =~ s/ DEFAULT(.*)// ;
print "$_\n" ;
if (/^.*\((\d+)\).*$/) {
print "one:$1\n" ;
}elsif (/^.*\((\d\d),(\d)\).*$/) {
print "two :$2\n" ;
}
but i am not able to get digits if they are specified with comma in between like :
TXN_AMOUNT NUMBER (17,3)
for above i want 17 in 1 varaible and 3 in other but i m not able to manage it i get only digit specified after "," 3 for above case.