Hello,
I want to match a separate word which starts with # character.
enter #code here - #code
some#string here - nothing
#test - #test
I came up with following regex:
"enter #code here".replace(/\b#[\w]*/gi, "REPLACED")
But it doesn't work. After some testing i found that
"enter #code here".replace(/#\b[\w]*/gi, "REPLACED")
works just fine.
Now can someone explain why \b# part is incorrect in this case?
Thanks!