Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The problem is $3. I'm trying to match the following expression.
What am I doing wrong?$_ =~ /^ALTER\s+TABLE\s+(\w+)\s+ADD\s+CONSTRAINT\s+(\w+)\s+PRIMARY\s+K +EY\s+\(\s*(.)\s*)/; $table=$1; $name=$2; $col=$3; ---DATA--- ALTER TABLE ORDERS ADD CONSTRAINT PK_ORDER_ORDER_NUM PRIMARY KEY ( ORD +ER_NUM) ; ALTER TABLE ORDER_ITEMS ADD CONSTRAINT PK_ORDER_NUM_ITEMS PRIMARY KEY +( ORDER_NUM, ITEM_NUM, SUB_TYPE ) ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need a regex for matching multiple words within parentheses
by hanenkamp (Pilgrim) on Dec 12, 2003 at 18:42 UTC | |
by Not_a_Number (Prior) on Dec 12, 2003 at 19:51 UTC | |
|
Re: Need a regex for matching multiple words within parentheses
by ysth (Canon) on Dec 12, 2003 at 18:39 UTC |