Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a div:

<div id="crop"><span> text - 123 views</span></div>

I want crop from "-" to "v" ,thanks

share|improve this question

migrated from May 15 '11 at 19:19

This question came from our site for WordPress developers and administrators.

can you explain what you are wanting to do a little better. The term crop is to remove something like crop an image but i do not quite get crop from - to v. Also is the div user created or wordpress plugin core created. – xLRDxREVENGEx May 13 '11 at 3:47

1 Answer 1

var $span = $('#crop').find('> span');

    $span.text().replace(/^[\s\S]*-\s+(\d+)\s+[\s\S]*$/m, '$1')
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.