3

How can I get the first function parameter with javascript regex? For example, I have this element in the page and I want to retrieve the inline link when clicking on a tag. sample:

<li><a href="#blog" data-rel="close" onclick="getRSSFeed('http://moi.ir/Portal/RssPage/ShowRss.aspx?CategoryID=541ac873-3706-4f31-97e7-5cd6d51170eb','BlogList');">news</a></li>

I want this text : http://moi.ir/Portal/RssPage/ShowRss.aspx?CategoryID=541ac873-3706-4f31-97e7-5cd6d51170eb

1 Answer 1

3
onclick[^(]*\('([^']+)

Try this.Grab the groups 1.See demo.

http://regex101.com/r/yR3mM3/54

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.