You can extract all the characters before a specific character in a string using a regular expression in a Nintex Automation Cloud (NAC) workflow.
Here are the steps to follow:
- Insert an “Apply a Regular Expression” action into your workflow.
- Configure it with the following settings:
- Input text = Your text string (you can insert a variable or text directly)
- Operation = Extract
- Pattern = ^([^\/]+)
- Where the “/” is the character to get text before.
- Replace the “/” with your desired character.
- Ignore case = Yes (this may not be relevant)
- Store first result in = Your workflow variable
- You can then use this workflow variable as you need it in your workflow.
Below are some examples from using this Regular Expression:
| String | Regular Expresssion | Result |
| yoursite.com/products | ^([^\/]+) | yoursite.com |
| 12345.689 | ^([^\.]+) | 12345 |
| 123;#ABC456 | ^([^\;]+) | 123 |

Leave a comment