Hi,

I have to store all words in an array suffixed with @ in an string.

For eg : var str = "Hello i @need help with @regexp";

\s@([A-Za-z0-9_]+\b) this regular expression gives me only @need not @regexp so please help.

check this link...
http://www.regular-expressions.info/javascriptexample.html

might be helpfull

thanks in advance .

Solved

<script type="text/javascript" >
var str = "#Hello i #am  writing a regexp #h";
var a = /#([A-Za-z0-9_])*/g;
 var res = str.match(a);
 alert(res[0]);
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.