When received regex syntax

Regex finds a word in the string

You're just missing a bit of work for it (plus that in the wrong position).

If you want to match the first occurrence:.
If you'd like to keep up with the last occurrence:.

This will be captured in 3 groups: everything before the exact match and everything following.

match almost everything (depending on your settings), but only a single character.
the preceding element becomes optional, i.e. they do not appear at all or exactly once.
corresponds to the preceding element several times, i.e. not for all or an unlimited number of times. This will match as many characters as possible.
If you combine the two to get an ungreedy match, essentially matching as few characters as possible (up to 0).

To edit:
As I've read you only want and the complete string will, depending on the implementation / language, the following should suffice: (again, the ungreedy match could be swapped with the gnawed one). You will receive the whole expression / game as group 0 and the first defined match as group 1.

Shareimprove this answer Mario