Get a specific word of of the sentence

Posted by sm21guy on Stack Overflow See other posts from Stack Overflow or by sm21guy
Published on 2012-03-25T11:22:49Z Indexed on 2012/03/25 11:30 UTC
Read the original article Hit count: 152

Filed under:

H ow can i get 123 out of ::123:: in a sentence then store it in a variable.

for example :

hi i am john ::123::.

It will look for :::: tags and get 123 from the it and strip off other words in the sentence. The results would be 123

I am not sure but is this able to work?

$(document).ready(function(){
    var store = $('.div').find(/::([^:]+)::/g);
    alert(store);
});

How can i do this using jquery?

© Stack Overflow or respective owner

Related posts about jQuery