typescript regex match version number code example Example: using a variable in regex javascript with boundary marker re = new RegExp(`\\b${sa}\\b`, 'gi');