Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?<index>^\s?\d)\s(?<flight_number>[A-Z\d ]{1,7})\s(?<depart_date>\d{2}[A-Z]{3})\s(?<depart_point>[A-Z]{3})(?<destination_point>[A-Z]{3})\s?(?<class>[A-Z|\d]{3})\s\s(?<depart_time>[ ?\d]{4}[ANP])\s(?<destination_time>[ ?\d]{4}[ANP][| | -1]{1,3})\s{6}(?<other_class>.{5})
/
gm

Description

simple sabre line parser

Submitted by aleks777 - 3 years ago