javascript - If a non 'word' character is specified in a RegEx string with \b, will the 'word' still match?' -


in javascript regex match \bmyword_txt_\b myword_txt_ 'word?'

yes work try:

"xxx myword_txt_ 123 nnn".match(/\bmyword_txt_\b/) 

it match myword_txt_ expected.

if need find several instances of myword_txt_ use global modifier in regex definition: /\bmyword_txt_\b/g