RegEx (regular expression) patterns are a standard type of coding used to match text.
In DocBoss, we use RegEx to parse card metadata from the file names when using the Create Cards and Match feature.
Formatting patterns
Common examples
- </^[^_]*/> - take first part before first "_" for ex 123_456_789
- </[^_]*$/> - take last part, for ex 1_23_45_67
- </_(.*)_/> - take the middle, for ex 1_23_45_67or you can replace "_" with "-" for the expressions above
- for example </^[^-]*/> - take first part before first "-" for ex 123-456-789
- </.*/> - takes all text (file name)
Include plain text
- To use the entire file name (without the extension) in a RegEx field, enter only the following text: /.*/
- To output plain text at the beginning of the value, use the following format: YourText</.*/>
- To output plain text at the beginning of the value, use the following format: </.*/>YourText
- To output plain text in the middle of the value, use the following format: </.*/>YourText</.*/>
Advanced
- There is lots of information online about formatting regular expressions. For example, see this guide from MDN Web Docs.