如何在不创建组的情况下表达“一个单词或另一个单词”?

I'm trying to match this kind of strings with a regular expression:

{{location|
{{location dec|
{{location other|

so I came up with this regular expression:

{{location( dec| other|)

which works fine, however it's creating a group at ( dec|), which I don't need. Is there any way to do the same thing but without creating a group?

You need a group, but you can make it a non-capturing group by adding ?: after the opening bracket:

(?: dec| other|)

Non-capturing means the group exists just for the expression; no back references are possible and group numbering is unaffected.

You can use ?: to prevent group creation so please give a try to:

{{location(?: dec| other|)