Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^([\w\d]{6})\s([\w\d]{2})\s+([\w\d]{1})\s+((\*)\s)?(.*)((NOTE|ORD|COM|CALL|PUT|PFD|OPTION|PARTNERSHIP\sUNIT|INT\sUNI|RIGHT|ORD|NAMEN\sAKT|DBCV|CL\sA|\*W|DEBT|SHS|UNIT).*)(DELETED|ADDED)?$
/
gmi

Description

Parses CUSIP text output from sec.gov

Submitted by Gary Vidal - 9 years ago