Forum Discussion

David__Pasch's avatar
David__Pasch
Icon for Altostratus rankAltostratus
Apr 10, 2018

Regex for variable monitor recv string

DevCentral, I have a regex ask.

 

I am trying to set up an http monitor that get this in the response "totalRows="3311"" I need to set up the recv string to accept any number from 1 to 9999 in the quotes.

 

Have tried:

 

totalRows=”[1-9][0-9]*”

 

totalRows=/”[1-9][0-9]*/”

 

and taken some other more desperate stabs in the dark I am too embarrassed to post. :)

 

Let me know if you have any ideas!

 

As always, Thanks in advance!!!

 

David Pasch F5-CTS

 

  • Try:

     

    totalReg=\"^([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9])$\"

     

    Someone else might have a niftier way of doing it but this should work. Note it could be a pretty resource-intensive test. You will probably want to benchmark it to see what adjustments you want to make to the monitor's interval and timeout values.