How to convert regex java in regex javascript
I have for example the text : #hello some text #Home
My Java regex is
String regex = "[#]+[A-Za-z0-9-_]+\\b";
Pattern tagMatcher = Pattern.compile("[#]+[A-Za-z0-9-_]+\\b");
the result is #hello and #Home
My Javascript code is :
var myRegExp = new RegExp("[#]+[A-Za-z0-9-_]+\\b");
var tagMatcher = text.match(myRegExp);
but the result is :
#hello
How can I solve the problem?
Where is my error?
#
instead of[#]
and[\w-]
instead of[A-Za-z0-9-_]
.