Select random paragraph

irmscher

Client
Регистрация
28.11.2012
Сообщения
199
Благодарностей
6
Баллы
18
Hey guys

I want to select and copy random paragraph from an article

Article body is surrounded by <div id="article-content"> </div>

Each paragraph is surrounded by <p> </p>

So how am I gonna crank it out?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 800
Благодарностей
1 187
Баллы
113
Take all article with regex - (?<=<div\ id="article-content">).*(?=</div>)
AND
Use (?<=<p>).*(?=</p>) to regex out paragraphs and take random one
:-)
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)