@singuerinc


2014.01.12 by Nahuel Scotti | 1 min read

Extract #hashtags


Hoy: Extraer mĂșltiples hashtags de una cadena de texto.

function extract(value){
    return value.match(/\B#\w*[a-zA-Z]+\w*/ig);
}

var tags = extract("lorem #tag1 #tag2 diem #tag3");
tags; // ['#tag1', '#tag2', '#tag3']
Demo
  • #hashtags
  • #javascript
  • #regex
  • #string