pvandivier PS> $tbl = @"
>> CREATE TABLE foo (
>> id INTEGER DEFAULT nextval('foo_id_seq'::regclass) NOT NULL,
>> bar VARCHAR(100),
>> baz VARCHAR(100)
>> CONSTRAINT hvs_pkey PRIMARY KEY (id)
>> )
>> "@
pvandivier PS> $pattern = "nextval\('([^']*?)'\:\:regclass"
pvandivier PS> [regex]::Match($tbl,$pattern).Groups[1].Value
foo_id_seq
pvandivier PS>