2

I have the string <option value=/digital/collections/newsouth62.html>1862</option> and I want to fetch only the 1862 from the above string using a regular expression.

4
  • 1
    Please read this: tinyurl.com/so-hints Commented May 23, 2011 at 12:47
  • You can google for things like this. Commented May 23, 2011 at 12:47
  • 1
    This is trivial to answer, but honestly it seems like you have put zero effort into trying AFAICT. Could you make a few attempts and post what you did? Commented May 23, 2011 at 12:54
  • @Oded, thanks for that link, first time I saw it! Commented May 23, 2011 at 12:55

1 Answer 1

2
pattern = "|<option.*?>(.*?)</option>|";
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.