This is perhaps a tricky one. Using a regex, I want to select the Arabic numbers (can be 1, 2 or 3 Arabic digits) between parentheses as well as the parentheses themselves here: http://jsfiddle.net/QL4Kr/.
<span>
كهيعص ﴿١﴾
</span>
<span>
وَإِلَيْهِ تُرْجَعُونَ ﴿٢٤٥﴾
</span>
jQuery(function () {
var oldHtml = jQuery('span').html();
var newHtml = oldHtml.replace("","");
jQuery('span').html(newHtml); });
Here’s what I came up with:
Here’s the jsFiddle to play with it: http://jsfiddle.net/leniel/YyAXP/
Here’s the modified version that keeps only the numbers inside each
<span>:The jsFiddle: http://jsfiddle.net/leniel/YyAXP/1/
To correct the misunderstanding, here’s a new version that does exactly what you want:
The corresponding jsFiddle is here: http://jsfiddle.net/leniel/YyAXP/2/
I hope this is your last requirement change! 🙂
Here’s the jsFiddle: http://jsfiddle.net/leniel/G4SkV/4/