Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
\s*(\d{1}\s{9})*(\r|\n|\r\n)\s*[0-9]{80}[\r|\n|\r\n]0\s*CMD\s(?<CMD>.{18})\sADJUSTMENT\sMONETARY\sSCREEN\s{8}IAJMON\s{3}PAGE\s(?<PAGECURRENT>\d)\sOF\s(?<PAGETOTAL>\d)\s*[\r|\n|\r\n]1\s{2}SCREEN\s(?<SCREEN>.{2})\s{2}ACTION\s(?<ACTION>.{2})\s{2}RA\sNUM\s(?<RANUMBER>.{10})\s*OVRD\s(?<OVRD>.{2})INVOICE\sNUM\s(?<INVOICENUM>.{15})[\r|\n|\r\n]2.*RES\sNUM\s(?<RESNUMBER>[A-Z0-9]{11})\s(?<COMPANY>\w{1})\s*[\r|\n|\r\n]3\s*CHK\sOUT\sLOC\s(?<CHECKOUTLOC>.{3})\s*DATE\s(?<CHECKOUTDATE>.{7})\s*TIME\s(?<CHECKOUTTIME>.{5})\s*MLS\/KM\s*(?<CHECKOUTMILEAGE>.{8})\s*FUEL\s(?<CHECKOUTFUEL>.{1})\s*[\r|\n|\r\n]4\s*CHK\s*IN\s*LOC\s(?<CHECKINLOCATION>.{3})\s*DATE\s(?<CHECKINDATE>.{7})\s*TIME\s(?<CHECKINTIME>.{5})\s*MLS\/KM\s(?<CHECKINMILEAGE>.{8})\s*FUEL\s(?<CHECKINFUEL>.{1})\s*[\r|\n|\r\n]5\s*AGREED\sRETURN\s(?<AGREEDRETURNLOC>[A-Z0-9]{3})\s*DATE\s(?<AGREEDRETURNDATE>.{7})\s*TIME\s(?<AGREEDRETURNTIME>.{5})\s*MLS\/KM\sDRIVEN\s(?<MILEAGEDRIVEN>.{12})[\r|\n|\r\n]6\s*WIZARD\sNUM\s(?<WIZARDNUMBER>.{7})\sAWD\sNUM\s(?<AWDNUMBER>.{8})\s
/
g

Description

no description available

Submitted by anonymous - 8 years ago