Business messages
Reservation confirmations sent as email: reservation number, rate, each surcharge as stated, tax, total, pick-up and return with place, date and 24-hour time, car group and the renter's numbers.
Subject: Avis Real-Time Reservations Confirmation
Avis Real-Time Reservations Confirmation
----------------------------------------------------------------------
NOTE: If you cancelled your reservation immediately after processing,
please disregard this confirmation.
----------------------------------------------------------------------
Thank you for choosing Avis. The following information was calculated
based on the information shown below that you provided to us. Changes
in pick-up or return location, car group, dates or times may change
this rate. This rate is for renters 25 years of age or older with a
major credit card in their name.
----------------------------------------------------------------------
Listed below is your reservation confirmation:
----------------------------------------------------------------------
Reservation Number.......: 35762788US5
Your rate for the 3 day
period is.............: 74.26 - USD
Mileage..................: Unlimited free Miles/Kilometers
Surcharge................: (Up to) $1.93 per day (Vehicle License Fee)
Tax......................: 7.750 %
Approximate Total........: 85.81 - USD
----------------------------------------------------------------------
You requested a reservation for:
----------------------------------------------------------------------
Pick-Up Location.........: John Wayne Airport - SNA
Pick-Up Date.............: Friday May 26, 2000
Pick-Up Time.............: 7:00 PM (1900)
Return Location..........: John Wayne Airport - SNA
Return Date..............: Monday May 29, 2000
Return Time..............: 4:00 PM (1600)
Car Group................: Intermediate-Pontiac Grand Am or similar
Name.....................: DANA WELLS
AWD#.....................: L602318
Frequent Flyer#..........: CONTINENTAL AIRLINES QM820614
----------------------------------------------------------------------
For additional information on the "Pick-Up Location", please go to:
http://www.avis.com/L/?STAMNE=SNA
If you need to REVIEW or CANCEL this reservation, please go to:
http://www.avis.com/R/?RES_NO=35762788US5&LASTNAME=WELLS
You will need both your Reservation Number (35762788US5) and Last
Name (WELLS) to enter.
If you did not make this reservation, please send an e-mail with the
above rental information to:
[email protected]
Debit, Check, or Cash Cards are not accepted as credit identification
at the beginning of an auto rental. An Avis honored charge card or an
Avis Cash Pre-payment ID Card is required at the beginning of the
rental. Debit, Check, or Cash Cards can be used at the end of the
rental for payment of rental charges.
----------------------------------------------------------------------
Thank you for booking your auto with Avis Rent A Car.
Avis Rent A Car: http://www.avis.com/
----------------------------------------------------------------------
US/BB-CR/L
-----
Subject: Avis Real-Time Reservations Confirmation
Avis Real-Time Reservations Confirmation
----------------------------------------------------------------------
NOTE: If you cancelled your reservation immediately after processing,
please disregard this confirmation.
----------------------------------------------------------------------
Thank you for choosing Avis. The following information was calculated
based on the information shown below that you provided to us. Changes
in pick-up or return location, car group, dates or times may change
this rate. This rate is for renters 25 years of age or older with a
major credit card in their name.
----------------------------------------------------------------------
Listed below is your reservation confirmation:
----------------------------------------------------------------------
Reservation Number.......: 41260969US1
Your rate for the 5 day
period is.............: 257.00 - USD
Mileage..................: Unlimited free Miles/Kilometers
Additional surcharges (some of which are mandatory) may apply to this
booking.
Tax......................: 19.600 %
----------------------------------------------------------------------
You requested a reservation for:
----------------------------------------------------------------------
Pick-Up Location.........: Nice Airport - NCE
Pick-Up Date.............: Thursday September 21, 2000
Pick-Up Time.............: 12:00 PM (1200)
Return Location..........: Nice Airport - NCE
Return Date..............: Tuesday September 26, 2000
Return Time..............: 12:00 PM (1200)
Car Group................: Group I - Renault Megane Convertible or similar
Name.....................: DANA WELLS
AWD#.....................: L602318
Frequent Flyer#..........: QM820614
----------------------------------------------------------------------
For additional information on the "Pick-Up Location", please go to:
http://www.avis.com/L/?STAMNE=NCE
If you need to REVIEW or CANCEL this reservation, please go to:
http://www.avis.com/R/?RES_NO=41260969US1&LASTNAME=WELLS
You will need both your Reservation Number (41260969US1) and Last
Name (WELLS) to enter.
If you did not make this reservation, please send an e-mail with the
above rental information to:
[email protected]
Debit, Check, or Cash Cards are not accepted as credit identification
at the beginning of an auto rental. An Avis honored charge card or an
Avis Cash Pre-payment ID Card is required at the beginning of the
rental. Debit, Check, or Cash Cards can be used at the end of the
rental for payment of rental charges.
----------------------------------------------------------------------
Thank you for booking your auto with Avis Rent A Car.
Avis Rent A Car: http://www.avis.com/
----------------------------------------------------------------------
US/BB-CR/L
-----
Subject: Avis Real-Time Reservations Confirmation
Avis Real-Time Reservations Confirmation
----------------------------------------------------------------------
NOTE: If you cancelled your reservation immediately after processing,
please disregard this confirmation.
----------------------------------------------------------------------
Thank you for choosing Avis. The following information was calculated
based on the information shown below that you provided to us. Changes
in pick-up or return location, car group, dates or times may change
this rate. This rate is for renters 25 years of age or older with a
major credit card in their name.
----------------------------------------------------------------------
Listed below is your reservation confirmation:
----------------------------------------------------------------------
Reservation Number.......: 30134505US2
Your rate for the 2 day
period is.............: 59.82 - USD
Mileage..................: Unlimited free Miles/Kilometers
Surcharge................: $0.75 per day (Customer Contract Fee) + 11.11% (Concession Recovery Fee)
Tax......................: 6.000 %
Approximate Total........: 72.05 - USD
----------------------------------------------------------------------
You requested a reservation for:
----------------------------------------------------------------------
Pick-Up Location.........: Newark Intl Airport - EWR
Pick-Up Date.............: Friday August 03, 2001
Pick-Up Time.............: 4:00 PM (1600)
Return Location..........: Newark Intl Airport - EWR
Return Date..............: Sunday August 05, 2001
Return Time..............: 4:00 PM (1600)
Car Group................: Group C - Pontiac Grand Am or similar
Name.....................: DANA WELLS
AWD#.....................: L602318
Frequent Flyer#..........: CONTINENTAL AIRLINES QM820614
----------------------------------------------------------------------
For additional information on the "Pick-Up Location", please go to:
http://www.avis.com/L/?STAMNE=EWR
If you need to REVIEW or CANCEL this reservation, please go to:
http://www.avis.com/R/?RES_NO=30134505US2&LASTNAME=WELLS
You will need both your Reservation Number (30134505US2) and Last
Name (WELLS) to enter.
If you did not make this reservation, please send an e-mail with the
above rental information to:
[email protected]
Debit, Check, or Cash Cards are not accepted as credit identification
at the beginning of an auto rental. An Avis honored charge card or an
Avis Cash Pre-payment ID Card is required at the beginning of the
rental. Debit, Check, or Cash Cards can be used at the end of the
rental for payment of rental charges.
----------------------------------------------------------------------
Thank you for booking your auto with Avis Rent A Car.
Avis Rent A Car: http://www.avis.com/
----------------------------------------------------------------------
US/BB-CR/Lbusiness-messages.ymlspec
Money: $local: Group: '\d+' Fraction: '\d+' Amount: $fields: groups: { $type: 'Group[]', $separator: ',' } fraction: Fraction $patterns: '#{groups}(\.#{fraction})?' $value: '#{groups}[.#{fraction}]' Currency: [ '[A-Z]{3}', '\$', '€', '£' ] $fields: { amount: Amount, currency: Currency } $patterns: - '#{amount} ?-? ?#{currency}' - '#{currency} ?#{amount}' $value: { amount: '#{amount}', currency: '#{currency}' } Percent: $local: { Number: '\d+(\.\d+)?' } $fields: { number: Number } $patterns: '#{number} ?%' $value: '#{number}' Date: $local: Weekday: '(Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)day|Mon|Tue|Wed|Thu|Fri|Sat|Sun' Month: January: { $patterns: [ 'January', 'Jan' ], $value: '01' } February: { $patterns: [ 'February', 'Feb' ], $value: '02' } March: { $patterns: [ 'March', 'Mar' ], $value: '03' } April: { $patterns: [ 'April', 'Apr' ], $value: '04' } May: { $patterns: 'May', $value: '05' } June: { $patterns: [ 'June', 'Jun' ], $value: '06' } July: { $patterns: [ 'July', 'Jul' ], $value: '07' } August: { $patterns: [ 'August', 'Aug' ], $value: '08' } September: { $patterns: [ 'September', 'Sept?' ], $value: '09' } October: { $patterns: [ 'October', 'Oct' ], $value: '10' } November: { $patterns: [ 'November', 'Nov' ], $value: '11' } December: { $patterns: [ 'December', 'Dec' ], $value: '12' } Day: '[0-3]\d' Year: '\d{4}' $fields: { month: Month, day: Day, year: Year } $patterns: - '(${Weekday},? )?#{month}\.? #{day},? #{year}' - '(${Weekday},? )?#{day} #{month}\.?,? #{year}' $value: '#{year}-#{month}-#{day}' SingleDigitDay: $local: { Day: '[1-9]' } $value: '#{year}-#{month}-0#{day}' Time: $local: Hour: '[01]\d|2[0-3]' Minute: '[0-5]\d' Clock: '\d{1,2}:\d{2} ?(AM|PM|am|pm|a\.m\.|p\.m\.)' $fields: { hour: Hour, minute: Minute } $patterns: - '${Clock} \(#{hour}:?#{minute}\)' - '#{hour}:#{minute}' $value: '#{hour}:#{minute}' Morning: $local: Hour: H00: { $patterns: '12', $value: '00' } H01: { $patterns: '0?1', $value: '01' } H02: { $patterns: '0?2', $value: '02' } H03: { $patterns: '0?3', $value: '03' } H04: { $patterns: '0?4', $value: '04' } H05: { $patterns: '0?5', $value: '05' } H06: { $patterns: '0?6', $value: '06' } H07: { $patterns: '0?7', $value: '07' } H08: { $patterns: '0?8', $value: '08' } H09: { $patterns: '0?9', $value: '09' } H10: { $patterns: '10', $value: '10' } H11: { $patterns: '11', $value: '11' } $patterns: '#{hour}:#{minute} ?(AM|am|a\.m\.)' Afternoon: $local: Hour: H12: { $patterns: '12', $value: '12' } H13: { $patterns: '0?1', $value: '13' } H14: { $patterns: '0?2', $value: '14' } H15: { $patterns: '0?3', $value: '15' } H16: { $patterns: '0?4', $value: '16' } H17: { $patterns: '0?5', $value: '17' } H18: { $patterns: '0?6', $value: '18' } H19: { $patterns: '0?7', $value: '19' } H20: { $patterns: '0?8', $value: '20' } H21: { $patterns: '0?9', $value: '21' } H22: { $patterns: '10', $value: '22' } H23: { $patterns: '11', $value: '23' } $patterns: '#{hour}:#{minute} ?(PM|pm|p\.m\.)' Fee: $local: Bound: { $patterns: '\(?up to\)?', $value: 'up to' } Unit: Day: { $patterns: [ 'day', '24 hours' ], $value: 'day' } Week: { $patterns: 'week', $value: 'week' } Hour: { $patterns: 'hour', $value: 'hour' } Rental: { $patterns: [ 'rental', 'rental period', 'rental agreement' ], $value: 'rental' } Mile: { $patterns: [ 'mile', 'mi' ], $value: 'mile' } Kilometer: { $patterns: [ 'kilometer', 'kilometre', 'km' ], $value: 'kilometer' } Name: '\p{L}[\p{L}\p{N}''&/\- ]*' $flags: [ CASE_INSENSITIVE ] $fields: { name: Name } Charge: $fields: { bound: Bound, amount: Money, per: Unit } $patterns: '(#{bound} )?#{amount}( (per|/|a|an) ?#{per})? \(#{name}\)' Share: $fields: { percent: Percent } $patterns: '#{percent} \(#{name}\)' Entry: $flags: [ MULTILINE, CASE_INSENSITIVE ] $local: Leader: '[ .]*:[ \t]*' ReservationNumber: $local: { Code: { $flags: [ -CASE_INSENSITIVE ], $patterns: '[A-Z0-9]+' } } $fields: { number: Code } $patterns: '^(Reservation|Confirmation) (Number|No\.?|#)${Leader}#{number}' $value: '#{number}' Rate: $flags: [ FLEXIBLE_WHITESPACE ] $local: { Days: '\d+' } $fields: { days: Days, rate: Money } $patterns: '^Your rate for the #{days} days? period is${Leader}#{rate}' Surcharges: $fields: fees: { $type: 'Fee[]', $separator: ' ?(\+|,|and) ?' } $patterns: '^Surcharges?${Leader}#{fees}' Tax: $fields: { rate: Percent } $patterns: '^Tax(es)?( rate)?${Leader}#{rate}' $value: '#{rate}' Total: $fields: { total: Money } $patterns: '^(Approximate|Estimated) Total${Leader}#{total}' $value: { amount: '#{total.amount}', currency: '#{total.currency}' } Stop: $local: Location: $local: Name: '[\p{L}\p{N}][\p{L}\p{N}.,''&/() \-]*?' Code: { $flags: [ -CASE_INSENSITIVE ], $patterns: '[A-Z]{3}' } $fields: { name: Name, code: Code } $patterns: '#{name}( - #{code})?[ \t]*$' $value: { name: '#{name}', code: '[#{code}]' } $fields: { location: Location, date: Date, time: Time } $patterns: '^${Event} (Location${Leader}#{location}|Date${Leader}#{date}|Time${Leader}#{time})(\n${Event} (Location${Leader}#{location}|Date${Leader}#{date}|Time${Leader}#{time}))*' PickUp: $local: { Event: 'Pick-?up' } Return: $local: { Event: 'Return|Drop-?off' } CarGroup: $local: { Text: '[\p{L}\p{N}][\p{L}\p{N}\p{P} ]*' } $fields: { group: Text } $patterns: '^Car (Group|Class|Type)${Leader}#{group}' $value: '#{group}' Renter: $local: { Name: '\p{L}[\p{L}''.\- ]*' } $fields: { name: Name } $patterns: '^(Renter )?Name${Leader}#{name}' $value: '#{name}' Discount: $local: { Code: { $flags: [ -CASE_INSENSITIVE ], $patterns: '[A-Z0-9]+' } } $fields: { number: Code } $patterns: '^(AWD|Avis Worldwide Discount|Discount)( Number| No\.?)?#?${Leader}#{number}' $value: '#{number}' FrequentFlyer: $local: Program: '\p{L}[\p{L}''&.\-]*( \p{L}[\p{L}''&.\-]*)*' Code: { $flags: [ -CASE_INSENSITIVE ], $patterns: '[A-Z0-9]*\d[A-Z0-9]*' } $fields: { program: Program, number: Code } $patterns: '^Frequent Fl(y|i)er( Number| No\.?)?#?${Leader}(#{program} )?#{number}' Reservation: $flags: [ MULTILINE ] $local: Other: '[\p{L}\p{N}\p{P}\p{S} \t]+' $fields: number: Entry::ReservationNumber rate: Entry::Rate surcharges: Entry::Surcharges tax: Entry::Tax total: Entry::Total pickUp: Entry::Stop::PickUp return: Entry::Stop::Return carGroup: Entry::CarGroup renter: Entry::Renter discount: Entry::Discount frequentFlyer: Entry::FrequentFlyer $patterns: '#{number}(\n+(${Other}\n+)*?(#{rate}|#{surcharges}|#{tax}|#{total}|#{pickUp}|#{return}|#{carGroup}|#{renter}|#{discount}|#{frequentFlyer}))+'
$ texomy parse input.txt -m business-messagesAbout this spec
Car-rental reservation confirmations sent as plain-text email: for each reservation its number, rental period and rate, surcharges, tax, approximate total, pick-up and return location, date and time, car group and the renter's name, discount and frequent-flyer numbers.
Package files
business-messages.ymlsamples/other.txtsamples/variants.txttests/business-messages.test.ymltests/expected/other.yamltests/expected/sample.yamltests/expected/variants.yamltexomy.json
166 nodes from 3 top-level matches.
Run it yourself
Save the example from Studio to a folder, then in that folder:
texomy parse input.txt -m business-messagestexomy testMore examples
Invoices
Supplier, invoice number, dates, amounts, payment terms and order references, plus charge rows that take their section from the table caption.
Bank statements
Account, period and balance summary, and transactions read from a table whose Debit and Credit columns give each amount its sign.
Education
Student, identifier, institution and print date in any order, and each term with its courses, grades, credit hours and totals.
Logistics
Bills of lading: references, vehicles, sender and receiver with addresses, cargo lines with count, kind and mass, and the totals, in whatever order the document states them.
Resumes
Candidate name, headline and contacts, each job and degree with its own dates, courses, and skills grouped under their area.
Addresses
Address blocks and one-line addresses: recipient, street or post office box with building, suite or mail stop, city, state, postal code and country.
Write the spec once. Run it on everything.
Install the CLI, connect your agent, and turn your first sample into typed data in minutes.
brew install texomy/tap/texomy