Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

Description

Hi All,

We got a database column which saving the table definition as patten string below. How can I extract the column & libelle information out of the string by using regular expression ? Thanks a lot !

c:{k:16:PERIODDEFINITION;c:{k:8:REVENUE1;c:{k:6:COLUMN;s:8:REVENUE1;k:7:LIBELLE;s:23:Revenue from Operations;k:4:NAME;s:3:REV;k:9:ALIGNMENT;s:1:1;k:2:RO;b:0;k:4:RO_R;b:0;k:7:FORMULA;s:28:([CAS(P)]+[INT(P)])/[INT(P)];};k:12:OTHERINCOME1;c:{k:6:COLUMN;s:12:OTHERINCOME1;k:7:LIBELLE;s:12:Other income;k:4:NAME;s:4:OINC;k:9:ALIGNMENT;s:1:1;k:2:RO;b:0;k:4:RO_R;b:0;};k:13:METAUSERNUM11;c:{k:6:COLUMN;s:13:METAUSERNUM11;k:7:LIBELLE;s:12:Total Income;k:4:NAME;s:4:TINC;k:9:ALIGNMENT;s:1:1;k:6:FORMAT;s:5:0,000;k:2:RO;b:0;k:4:RO_R;b:0;};k:1:@;c:{k:6:COLUMN;s:1:@;k:2:RO;b:0;k:4:RO_R;b:0;};k:5:COST1;c:{k:6:COLUMN;s:5:COST1;k:7:LIBELLE;s:8:Salaries;k:4:NAME;s:3:SAL;k:9:ALIGNMENT;s:1:1;k:2:RO;b:0;k:4:RO_R;b:0;};};k:16:GLOBALDEFINITION;c:{};k:24:INVESTORPERIODDEFINITION;c:{};k:19:ADDPERIODDEFINITION;c:{};k:24:INVESTORGLOBALDEFINITION;c:{};k:11:FILTERRULES;c:{};};

Submitted by anonymous - 10 years ago