regex - Extract string from HTML tags using RegExp (Ruby) -


i extract "toast" string <h1>test</h1><div>toast</div>. regular expression isolate such string?

edit: user who corrected formatting.

more info: there 1 instance of div tag, information inside may change there never div tag in same string (the string larger given sample)

thanks!

this not typically done regex... , reason, if must , since said there never more single div within it... should work you:

(?<=<div>).*(?=</div>) 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -