Forum Discussion

Nicolas_MENOUX_'s avatar
Nicolas_MENOUX_
Icon for Nimbostratus rankNimbostratus
Nov 23, 2009

regexp and # issue

Hi,

 

 

I'm trying to reload my bigip.conf file from my v9.3 appliance to the new v10 release but I'm stucked with a bracket issue with my conf file.

 

After analysing the file, I've discovered that this line is faulted :

 

 

 

} elseif {[regexp {^/foo-([^\.]*)-m([0-9]+)([0-9]+).html} $uri url param1 param2 param3]} {set uri_rewrite "/foo/Default.aspx?g=posts&m=$param2&boardid=5&$param3"

 

 

 

The issue is coming from the first between ([0-9]+)([0-9]+). I think it is treated as a comment and thus the bracket pb.

 

 

I've tried to put a \ before but nothing changes. Is there any way to replace this with an encoded sequence or use another special character to prevent this from being a comment.

 

 

Thanks for your help,

 

 

Regards

3 Replies

  • Hi Nicolas,

     

    Try creating a variable and then passing the variable to the regexp to see if that works.

     

     

    Bhattman

     

     

  • You could try replacing the curly braces with quotes and then escaping the square braces:

     
        if {0}{ 
            do something 
        } elseif {[regexp "^/foo-(\[^\.\]*)-m(\[0-9\]+)(\[0-9\]+).html" $uri url param1 param2 param3]} { 
            do something 
        } 
     

    Aaron
  • Hi Aaron and Bhattman

     

     

    thanks for your help, I've just tried the double quotes instead of curly braces and it works well ! I do not remember why I originaly used these curly braces, I think it was linked with some regular expression in my stream matched irules where I could not use the double quote .... I've to study again the regexp syntax ... anyway thanks a lot ;-)

     

     

    Nicolas