Regular Expressions 101

Community Patterns

1...34567...902

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^\s*(?<recno>\(\d+\))\s+([^\d]+)\s+(?<r1_date>\d{4})\s+(?<r1_total>[\d,.]+)\s+(?<r1_salaries>[\d,.]+)\s+(?<r1_wagesearnings>[\d,.]+)\s+(?<r1_totalpersonsemployed>[\d,.]+)\s+(?<r1_proprietors>[\d,.]+)\s+(?<r1_salaried>[\d,.]+)\s+(?<r1_waged>[\d,.]+)\s+(?<r2_date>\d{4})\s+(?<r2_total>[\d,.]+)\s+(?<r2_salaries>[\d,.]+)\s+(?<r2_wagesearnings>[\d,.]+)\s+(?<r2_totalpersonsemployed>[\d,.]+)\s+(?<r2_proprietors>[\d,.]+)\s+(?<r2_salaried>[\d,.]+)\s+(?<r2_waged>[\d,.]+)\s*$
/
gmi

Description

Test regex for sample page from census of industrial production

Submitted by Peter Corrigan - 7 years ago