Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(?im)^[ ]*(?<ISIN>\S+)[ ]{2,}(?<Type>\S+)[ ]{2,}(?<Underlying>.{1,50}?)[ ]{2,}(?<NumberOfShares>\d[\d.,]*)[ ]{2,}(?<Expiry>\d{2}[ ]*\.[ ]*\d{2}[ ]*\.[ ]*\d{4}|[ ]{10,20}?)[ ]{2,}(?<MinExercise>\d[\d.,]*)[ ]{6,20}(?<StartOfExercisePeriod>\d{2}[ ]*\.[ ]*\d{2}[ ]*\.[ ]*\d{4}|[ ]{8,10}?)[ ]{2,}(?:(?<EndOfExercisePeriod>\d{2}[ ]*\.[ ]*\d{2}[ ]*\.[ ]*\d{4}|[ ]{8,10})[ ]*)$
/
g

Description

tmp saved to work on it further ...

Submitted by mhergh - 7 months ago