I need to find word ( I know it) in a text of any lenght, like the following.
My text is very beautyfull. Yours $text is very bautyfull. Their #text, is very beautyfull
#
and $
are only sample. I can have any non-alphnumerical character
I have found the following regex:
(?<=^|[^a-zA-Z0-9])\Q<word>\E(?=$|[^a-zA-Z0-9])
tath work very well if i search #text
or $text
, but when i search only text
it match all occurrences (three in example below) instead only one occurrence text
.
Is there a way to do this with regex?