Forum Discussion
nshelton85
Mar 09, 2020Altostratus
Basic findstr question
So when using findstr, for instance set user [ findstr [HTTP::payload] "user=" 5 & ], I know that the 5 & means to return all data after "user=". If my user ID is 5555555555@domain.com, but has addi...
Simon_Blakely
Mar 10, 2020Employee
findstr is a simple string search function, and you can't really do anything complex with it.
For more complex string extraction, you probably need a regular expression
iRules 101 - #10 - Regular Expressions
However, be aware that using a regex is computationally expensive.
If your URL is /test?user=5555555@my.domain.com&pass=.....
user=(.*@([\w*\.]*))(\&|\#|$)
Then from the above regex, the Group 1 match is 5555555@my.domain.com
You can be more selective about what you terminate on.
To play with regex, go to regex101.com
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