Forum Discussion
John_45699
Mar 14, 2012Nimbostratus
Parentheses in stream expression
I need to search for and replace a string that includes a "(". Whenever I try this, I get a regex compilation error because the parentheses are not balanced. How do I make this work?
Here is my stream expression. I'm stuck and appreciate any help that I can get.
set stream_expression_cmd "STREAM::expression \"@/sap(@/test/sap(/@\""
- hooleylistCirrostratus...
- hooleylistCirrostratusIf you aren't using variables in the stream expression you can wrap it in curly braces and avoid the need to escape meta-characters:
- John_45699NimbostratusAaron, I tried that, but I still get the same regex compile error.
- hooleylistCirrostratusAre you using this iRule on multiple virtual servers where some may not have a stream profile enabled? If not, can you skip setting the stream expression in a variable and eval'ing it?
- hooleylistCirrostratusThat's an odd one. Can you try replacing the ( with \x28? This worked in a simplified test on 10.2.3:
STREAM::expression {@/sap\x28@/test/sap(/@} or: set stream_expression_cmd {STREAM::expression {@/sap\x28@/test/sap(/@}}
- John_45699NimbostratusStill not working, but now getting the following error: Can't compile regular expression - (/sap(?:)
- John_45699NimbostratusThanks for your help Aaron. It is much appreciated. I was able to make this work on 10.2.3.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects