Regex in Retool: Contains a substring?

272 Views Asked by At

I have a simple text field in Retool that I would like to validate includes the substring "-demo" So anything like test-demo, jeremy-demo, etc. would be acceptable. I'm sure with extra thought I could prevent stuff after the -demo part too, but one step at a time..

The closest I've gotten is using the pattern \-demo which is validating only when the string is EXACTLY "-demo" no more no less.

Using their own RegEx Tester (here) I've found /\-demo/g to work, but it does not actually work in practice.

0

There are 0 best solutions below