Forum Discussion

ramann_75062's avatar
ramann_75062
Icon for Nimbostratus rankNimbostratus
Apr 23, 2009

Regex in parameter name

 

Hi@all,

 

 

i have again a question about regex :-)

 

 

We have parameters like

 

 

name_1=

 

name_2=

 

...

 

name_9999=

 

 

 

Is there a way to set this parameter in a regex like

 

 

name_[1-9]=

 

 

We use BIG-IP 9.4.6 Build 401.0 Final

 

 

 

THanks for help

 

Bjoern

2 Replies

  • Benjamin_9036's avatar
    Benjamin_9036
    Historic F5 Account
    Hey Bjoern,

    You can use some fairly simple patterns for wildcard entities, but none that would allow the expansion of characters you mention. You can use [list/sequence] like your example, 'name_[1-9]' but there is no way to attach a quantity to the sequence. Using 'name_[1-9]*' would simply match 'name_', a digit 1-9, then anything. Likewise, 'name_[1-9]{4}' will match 'name_', a digit, and the {4} characters literally.

    If you know that the number will never reach a certain value, say 1,000, you could create multiple parameters:

    'name_[1-9]', 'name_[1-9][0-9]', 'name_[1-9][0-9][0-9]'

    This obviously becomes unwieldy, however, if the number has no ceiling. In that case, the more basic wildcard is still an option. Even 'name_*' or perhaps 'name_[1-9]*' to make sure the value at least begins with a number.
  • You might also consider opening a case with F5 asking them to support regular expressions for wildcard object types, objects, parameters, etc. I think there is an existing Request For Enhancement.

     

     

    Aaron