Forum Discussion
nshelton85
Altostratus
Mar 09, 2020Basic 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
Employee
Mar 10, 2020findstr 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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
