Regular expression with line break - help needed

Mufasa

Новичок
Регистрация
28.10.2014
Сообщения
13
Благодарностей
1
Баллы
3
Hello guys, if there is an empty line like in this example, how must the regex look like?
DOM-text looks like this

Код:
um Ihren kostenlosen Zugang zu aktiviern, müssen Sie folgenden Link anklicken

http://www.domain.com/activate123xyz

Sollte dieser Link nicht funktionieren, kopieren Sie ihn bitte
I need the whole domain but when I use

(?<=anklicken)[\w\W]*(?=Sollte)

I get 2 empty lines before the result. Would appreciate some help.
 
Последнее редактирование:

CSS

Client
Регистрация
22.05.2010
Сообщения
1 327
Благодарностей
663
Баллы
113
dirty hack:
Код:
(?<=anklicken[\w\W]*)http.*(?=\r\n \r\nSollte)
or you can use another way, this regex will find any url:
Код:
(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?
 
  • Спасибо
Реакции: Mufasa

Mufasa

Новичок
Регистрация
28.10.2014
Сообщения
13
Благодарностей
1
Баллы
3
dirty hack:
Код:
(?<=anklicken[\w\W]*)http.*(?=\r\n \r\nSollte)
or you can use another way, this regex will find any url:
Код:
(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?
thanks, worked great in that case.
however i dont get any result when trying with this DOM

Код:
<br>
Dein Freischaltecode lautet:<br>
<br>
XYZ123<br>
<br>
Trage diesen Code im Browserfenster ein.
any idea?
 

CSS

Client
Регистрация
22.05.2010
Сообщения
1 327
Благодарностей
663
Баллы
113

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