I want a pattern to match *instance*stuck* in a sentence, the number of words between instance and stuck can be 1 to 3. How can I write this pattern with regular expression in Java?
For example:
- "The instance stuck" will match the pattern
- "The instance just got stuck" will match the pattern
- "The instance in the server 123 at xyz is stuck" will NOT match the pattern