Thanks, as it is a transaction step in the CAS, I just select operation and then use the string:
I just wan't sure if wildcarding everything before the URI would be quicker for the CAS to process?
There should not be an issue to process for the CAS.
I am writing the below information regarding the 'Best Practices for Regular Expressions'.
Use of regular expressions significantly increases the computing load on the AMD and may significantly affect performance, so unnecessary use of regular expressions or use of overly complicated regular expressions should be avoided.
Do not use the match anything expression (a period followed by an asterisk “.*”) unless necessary.
A large factor in regex performance is how early your regex terminates for non-matches. Arguably one of the best ways to accomplish this is with more specificity in your regex (e.g. more literal characters). Arguably the worst way to go about regex performance is by using wildcards. Before using the .* or .+ wildcards you should always consider if you can replace them with something more specific.
If you absolutely need the wildcard, at least include as many literal characters in front of it as possible. This will help weed out non-matches before they reach the costly wildcard.
As for the regexes you listed we cannot definitively say which will perform best because it partially depends on the input. But here are my thoughts. Your first regex has more literal characters than the rest so that is good, but it has TWO wildcards - that is not good. Because of the two wildcards your first regex is almost certainly the least efficient.
For your second and third regexes, I would say the second is better because it has more literal characters. However it's noteworthy that in the case that all of your inputs start with http:// then the third regex is really no less efficient because your second regex is not rejecting any more matches with its literal characters if every input has them anyway.
More literal characters is good. More wildcards is bad. Replace wildcards with literals when possible or at least try to lead the wildcard with as many literals as possible
There are a ton of other things to say about regex performance but these are probably the most critical concepts.
Hope that helps,