Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?'char'[A-F0-9]{4,7})\;(?'replace'.*)(?:\s{1}(?'replace'[A-F0-9]{4,7}))+(?=\s)+(?:\s{1}(?'replace'[A-F0-9]{4,7}))+(?=\s)+(?:\s{1}(?'replace'[A-F0-9]{4,7}))+\;\ (?'comment'.*)(?:\n)| (?'char'[A-F0-9]{4,7})\;(?'replace'.*)(?:\s{1}(?'replace'[A-F0-9]{4,7}))+(?=\s)+(?:\s{1}(?'replace'[A-F0-9]{4,7}))+\;\ (?'comment'.*)(?:\n)| (?'char'[A-F0-9]{4,7})\;(?:\s{1}(?'replace'[A-F0-9]{4,7}))+(?=\s)+(?:\s{1}(?'replace'[A-F0-9]{4,7}))+\;\ (?'comment'.*)(?:\n)| (?'char'[A-F0-9]{4,7})\;(?'replace'.*)\;\ (?'comment'.*)(?:\n)| (?'range_start'[A-F0-9]{4,7})\-(?'range_end'[A-F0-9]{4,7})(?:\;\ )(?'comment'.*)(?:\n)| (?'char'[A-F0-9]{4,7})(?:\;\ )(?'comment'.*)(?:\n)| (?'range_start'[A-F0-9]{4,7})\-(?'range_end'[A-F0-9]{4,7})(?:\n)| (?:^\ {3})(?'char'[A-F0-9]{4,7})(?:\n)| (?<appendix>(?'appendix_type'Start|End)\sTable\s(?'appendix_number'(\w).(?'appendix_order'(\d)))(?=\ -----\n))
/
xgJm

Description

Matching expressions from lists of maps as samples:

0221 0234-024F 02AE-02AF 03AB; 03CB; Case map 03B0; 03C5 0308 0301; Case map 013D; 013E; Case map 0080-009F; [CONTROL CHARACTERS] 06DD; ARABIC END OF AYAH 070F; SYRIAC ABBREVIATION MARK 180E; MONGOLIAN VOWEL SEPARATOR 200C; ZERO WIDTH NON-JOINER

Submitted by Marin Sagovac - 3 years ago