Jump to content
Ketarin forum

Regex Request Thread


Tomorrow
 Share

Recommended Posts

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.com

Capture: 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.com

Capture: 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

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.