The following regExp will match 3 words before and after **if they exist**

```
((?:\w+\s+){0,3}My_WORD_HERE(?:\s+\w+){0,3})

```

Output will be like this:

```
word1 word2 word3 My_WORD_HERE word1 word2 word3

```

or 

`word1 word2 My_WORD_HERE word1` which leads to empty attributes.

How can we fill the missing words with a value such as '?' or any symbol? 

The output would be like this 

`word1 word2 ? My_WORD_HERE word1 ? ?`

I will be using this output for Weka ML

Thanks a lot everyone