Question: This is the text

```
Tutorial<del class="del">Within word</del>WordEnd sample <del class="del">total word</del> Welcome to the site!

```

I am trying to write regex to select tag `<del>` and anything between `<del></del>` and text beside it, but only select those `<del>` tags which do not have space between the tag and the preceding text.

For example in the above text - `Tutorial<del class="del">Within word</del>WordEnd` must get selected. But `<del class="del">total word</del> Welcome` must not get selected, as there is a space between and Welcome.

Anyone please help. Thanks in advance !!

Answer: 
Final attempt:

```
"/(\w+<del.*?>.*?(<\/del>\w+|<\/del>))|(<del.*?>.*?<\/del>\w+)/g"

```

<https://regex101.com/r/mD8zF7/10>
I think this is what you are looking for:

```
/([^\s]+)(\<del)(.*?)(\<\/del\>)([^\s]+)/

```

Example: <https://regex101.com/r/sL8jV8/1>

If you're looking for multiple matches in a string (above is just 1) use this one:

```
/([^\s]+)(\<del)(.*?)(\<\/del\>)([^\s]+)/g

```

Example: <https://regex101.com/r/hE6dH4/1>