I'm searching a regex in js to match string doesn't start with # the opposite of this function
String.prototype.parseHashtag = function() {
return this.match(/[#]+[A-Za-z0-9-_]+/g);
}
t="#lorem #ipsum yes no";
console.log(t.parseHashtag()); // ["#lorem", "#ipsum"]
I found this Regex: Finding strings that doesn't start with X
but the regex doesn't work /([^#]|^)[a-z]/ or maybe I'm tired… I do a replace() but really be curious to understand how to do it in match()!
Here is a js : http://jsfiddle.net/d8HVU/1/