0

I am trying to use Regex with Brio interactive reporting I have a column in the results set called event. There is a compliance guide how this event should be inputted. The aim of the report is to find out who isnt doing it correctly and correct them

An example of what should be there is 05/0035

I have created the script below which should output compliant if 05/0035 However Brio doesnt like it and gives me an syntax error message. Has anyone used it correctly before?

strSearch = Event;
regx = ^[0-9]{2}/[0-9]{4}
if (regx.test( strSearch )) {
"COMPLIANT"
}

Can anyone see the problem

Thanks

John Smith
  • 2,448
  • 7
  • 54
  • 78

1 Answers1

1

You should close your statements and enclose the regex with two /, like below:

strSearch = Event;
regx = /^[0-9]{2}/[0-9]{4}/;
if (regx.test( strSearch )) {
"COMPLIANT"
}
Stephan
  • 41,764
  • 65
  • 238
  • 329
  • Thanks Alex. I have used your code to come up with if (Event.search(/Hello World/) !=-1) {1} and it works. Thank you for your help – John Smith Dec 16 '13 at 14:09