Tomorrow Posted June 18, 2011 Report Share Posted June 18, 2011 I was thinking it would be nice to have a thread where those who don't know how to use regex, could ask those who can for solutions. First a few rules i think.Always post the website and the string you're after.For example: Website: www.example.comCapture: version This should represent the exact text you're trying to get.For example 1.42 or www.example.com/subpage Being specific would minimize any further questions. or Website: www.example.comCapture: everything between [version][/version] This should be used if you want to capture text between certain HTML tags.Useful if the text between them is long. --------------------------------------------- This should minimize extra questions and keep the topic clean. Obviously users can submit multiple answers to a question and several users can answer the same question (unless you want to impose a rule that a question is considered answered with first correct code that the question asker confirms as working.This would make the topic cleaner.) Each question should be submitted to it's own post.Please do not edit your existing post to ask a new question! Link to comment Share on other sites More sharing options...
Tomorrow Posted June 20, 2011 Author Report Share Posted June 20, 2011 Ok so i will start: Website: https://addons.mozilla.org/en-US/firefox/addon/about-startup/versions Capture: Everything between the first occurance of <div class="prose userinput" > and </div> Link to comment Share on other sites More sharing options...
necrox Posted June 21, 2011 Report Share Posted June 21, 2011 @Tomorrow This one should work. (?<=\<div class=\"prose userinput\".*?\>).+?(?=\<\/div\>) Use the .*? betweeen userinput" and > in case Mozilla fix their html source code and change it back to userinput"> without the space between. Link to comment Share on other sites More sharing options...
Tomorrow Posted June 21, 2011 Author Report Share Posted June 21, 2011 necrox , yes this seemed to work.Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now