Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(\s*\{(?:\s*"Modulus"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()|\s*"Exponent"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()|\s*"P"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()|\s*"Q"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()|\s*"DP"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()|\s*"DQ"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()|\s*"InverseQ"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()|\s*"D"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()){8}\s*\}\s*\2\3\4\5\6\7\8\9)|(\s*\{(?:\s*"\s*Modulus\s*"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()|\s*"\s*Exponent\s*"\s*:\s*"[a-zA-Z\d\+\/\\]+={0,2}"\s*,()){2}\s*\}\s*\11\12)
/
gm

Description

Final comma need to be replaced with empty.

Submitted by anonymous - 4 years ago