Forum Discussion
Diego_19194
Nimbostratus
Aug 14, 2007iRule limits
I am writing a iRule where check in a regexp a number in the mail message.
To do that, I used the command matches_regex but when I finished the regexp to add in the iRule, I found it is so big.
Could you tell me what is the regexp limit recommended to use in a iRule?
A text file with all regexp has a size of 500K. I can't upload in the forum because we have a limit of 100K.
16 Replies
- Andy_Herrman_22
Nimbostratus
500K is the size of the regex itself? If that's the case then you probably should use something other than a regular expression for your check. - Diego_19194
Nimbostratus
Yes, it is the size. I know is too big, but - Andy_Herrman_22
Nimbostratus
I have trouble believing a 500K regex could possibly be the most efficient way to do the search. - Al_Carandang_11
Nimbostratus
A 500K regex is large. Maybe if you post a small part of the regex like the first hundred or so characters we could see how it could be rewritten (if at all possible) - Diego_19194
Nimbostratus
I attached a small range of this rules. - Andy_Herrman_22
Nimbostratus
Your ranges look like they can be compressed, potentially by a lot.long value = extractValueFromRequest(); if( (value > 5491140300000 && value < 5491140379999) || (value > 5491144230000 && value < 5491144299999) ) { doStuff(); } else { reject(); }
- Diego_19194
Nimbostratus
Remember that it is a simple example and my script fix this problem explained for you. - Andy_Herrman_22
Nimbostratus
170k if statements that are doing simple numerical checks are probably going to be much faster than an 500k regular expression (which would probably be executing a lot more than 170k if statements while executing). - Kirk_Bauer_1018
Nimbostratus
And 170k if statements are probably too big as well. I'd say they would be 100 times more efficient than a regexp of that size, maybe even 1000 times. But ultimately I would spend your efforts on finding a better solution, maybe at the application level itself, or maybe by explaining to us what you are trying to do and seeing if there is a drastically easier method of doing what you want to do. - Deb_Allen_18Historic F5 AccountPerhaps the larger issue is that a human will have to manually evaluate the list's current incarnation to realize the potential of concatenating the blocks into the desired concise mapping of MSISDN to provider.
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