javascript - jQuery getting specific value in page title -


(1) website name

(3) website name - 08-08-2013 new york city

from examples above, how able value between parentheses using jquery or javascript?

i understand able title using code below

var current_title = $(document).attr('title');

but unsure how pinpoint actual value between parentheses

in case use:

'(3) website name - 08-08-2013 new york city'.split(')')[0].substr(1); // so, acquired title: $(document).attr('title').split(')')[0].substr(1); 

alternatively, regexp replacement same

$(document).attr('title').replace(/^(\()(\d+)(\)).*$/,'$2'); 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -