You might need in some cases an equivalent of a “custom entity”: we got you covered 😉
If you are in need of matching part of a user response, and store it as a specific value, we can help you.
Let’s say for example you want to be able to match order references: no worry, we are going to explain you how to do that.
![](https://downloads.intercomcdn.com/i/o/67222692/1fc6de2e612b393cf5856f94/Capture+d%E2%80%99%C3%A9cran+de+2018-07-11+12-02-51.png)
In the step where you ask your user for a reference, go into the “then” configuration section at the bottom of your step, click on “Add condition” and select IF “User response” “Matches Regex”:
![](https://downloads.intercomcdn.com/i/o/67222785/9ab933238ecf277e33c62b63/Capture+d%E2%80%99%C3%A9cran+de+2018-07-11+12-02-09.png)
Good; we are now going to build a Regex, and use the Named Capturing Groups to save match into a Session Value.
In our imaginary case, the order reference is always composed of 2 letters followed by 5 digits. The Regex should then be:
\w{2}\d{5}
To have a better understanding on how to create Regex, you can follow this dedicated tutorial.
Now, adding capturing group, and imagining the user could introduce his reference with some text:
.*?(\w{2}\d{5})
And finally, transforming the Capturing Group into a Named Capturing Group:
.*?(?P<order_ref>\w{2}\d{5})
![](https://downloads.intercomcdn.com/i/o/67223730/77d97232a4bb10437655e337/Capture+d%E2%80%99%C3%A9cran+de+2018-07-11+12-11-49.png)
Et voilà! The mach will be then recorded and accessible in
{{@session.order_ref}}
in next step 😊
![](https://downloads.intercomcdn.com/i/o/67223683/84ac01bbd9189decb0f6c5bf/Capture+d%E2%80%99%C3%A9cran+de+2018-07-11+12-11-17.png)