Additional RegEx Expressions
Regular Expressions are used as the expression logic in FormTrap due to its power to isolate anything you might require and for standards of its documentation.
The common Regular Expressions are included in the list shown by the Wizard, and you are free to add your own expressions to this list. Some expressions contain FIXME as a placeholder for "Equal to", "Contains" and others. For these, please select then change FIXME to whatever you want to test for (or not for).
Below are additional RegEx Expressions used by FormTrap and customers of FormTrap that may be useful. This list is updated from time to time.
FIXME
FIXME is included for you to replace in many of the standard RegEx expressions. You may replace just the one instance, or amend the expression to include multiple values. This shows the original, and a modified RegEx that identifies all of the various Invoice format document types (| (pipe symbol) means another instance).
Original:
Modified:
Character after Line End
This expression is used to recognize lines of product description
and separate them from comments where neither record has anything
that can be tested, except length of the line. Product Description
is a fixed shorter length than Comment line which is also a fixed
length, 80 columns. The position tested is after the line end in
Product Description. The character (for Product Description) does
not exist, while the position for Comment does exist.
Above shows the record data, while below shows addition of the rule
that detects Prod Name.
Note: From Version 8.20 and later where an
"empty" Match (evaluate) what: is allowed (earlier
versions flag "empty" as an error).
This is the resulting XML file for this product (note that Product
Comment are also Repetitive).
RegEx to convert company names into usable File or Folder names:
Certain characters are illegal or cause issues (example Company
P/L used as a Folder Name gives this: ..\Company P\L
with an unwanted additional Folder Name ..\L).
This RegEx expression both removes illegal characters and suppresses
resulting trailing spaces:
These are Bill To Name without and with the above filter
applied, from the output XML file:
Documentation of RegEx is on the web at a number of sites. We find these useful:
- http://regular-expressions.info/ for tutorials
- https://regex101.com/ for debugging existing expressions
- https://stackoverflow.com/ for a developer web site that has various useful expressions
Support is not available under our Support and Upgrades contract with customers. If you have issues with RegEx and/or require new RegEx made for you we will do this at our then current consulting rates, in 15 minutes increments (current rates for calendar 2023-24 are AUD $110/15 minutes including GST and USD $65/15 minutes).