What does this expression return?
'cat concat'.replace(/\Bcat/g, 'X')
- 'cat conX'
- 'X conX'
- 'X concat'
- 'cat concat'
\B is a non-boundary, so it only matches "cat" when it is preceded by another word character.'cat concat'.replace(/\Bcat/g, 'X')
\B is a non-boundary, so it only matches "cat" when it is preceded by another word character.