Let's say I have a regular expression that looks like (using Perl syntax for a replacement, but question is meant to be generic):
s/(example|something|ex)/xxx/g
Can I assume the search is performed "in order", ie, that it will match "example" before it matches "ex"? Or applying it to a string that looks like "example1 example2" can have different results depending on the language/implementation?
(tested it on Perl and it looks like it honors the order in the regex, but is this generic?)