Of course, you can simply combine pattern strings with |
. If you have strings representing patterns string1
and string2
, then string1|string2
will match any pattern. In your example, you can use the string ".................|xxxxxxxxxxxxxxxxx"
.
Of course, things get more complicated if you use capture groups or repeatedly match patterns with substrings, because then it is not clear what it means to βcombineβ patterns, but for simple matching / no -math, this works.
source share