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

matlab - Deleting rows with specific rules -

image - ClassNotFoundException when add a prebuilt apk into system.img in android -