QAID # 14658 Published
Question / Problem:
What may be the cause of inconsistent matching of spaces when using Regular Expressions in Format Locators in a KTM project?
Answer / Solution:
There are two elements which, in combination, may cause Regular Expression matches involving spaces to seem inconsistent.
- Spacing on a document can be interpreted by the Regular Expression engine as space characters OR tab characters.
- Contrary to many flavors of Regular Expressions, the engine used by KTM interprets
\sONLY as a space character rather than a more broad collection of whitespace characters such as tab and newline.
In situations where this may cause failed or inconsistent matching, use of
\s can be replaced with
[\s\t] which creates a character class that matches space or tab characters.