[SOLVED] Regex builder bug

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Code:
HTML:
http://thorspor20.blogbaker.com/admin/?p=posts.edit&amp;postID=1494589">durklis2 un nekas cits</a></div><div class="actions">[ <a href="http://thorspor20.blogbaker.com/admin/?p=posts.edit&amp;postID=1494589">Edit</a> | <a href="http://thorspor20.blogbaker.com/admin/?p=posts.list&amp;a=posts.statuschange&amp;postID=1494589&amp;sub_a=trash" class="bad">Trash</a> | <a target="_blank" href="http://thorspor20.blogbaker.com/2012/12/05/durklis2-un-nekas-cits">View</a>
Need:
Код:
http://thorspor20.blogbaker.com/2012/12/05/durklis2-un-nekas-cits
Regex:
Код:
http://.*(?=">View)
Not Working....


Please do not post another working regex, but resolve this regex builder bug...

Thanks
 

CSS

Client
Регистрация
22.05.2010
Сообщения
1 327
Благодарностей
663
Баллы
113
I have no see bug here, because you have HTML code in single string. So parsed trash. I recomend you use parsing via PBC by flag (tag a, with innertext "View"). Also you can solve your trouble via regexp, in this case it will looks like this:
Код:
http:\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])(?=">View)
Result:
Код:
http://thorspor20.blogbaker.com/2012/12/05/durklis2-un-nekas-cits
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Hell yeah i posted this part of code in notepad and understood where is problem :-)

But anyway your given regex is too long. i'm used:

HTML:
(?<=blank"\ href=").*(?=">View</a>)
I'm using regex builder for most of my stuff as i'm not regex expert. As i see you wrote your regex manually :-)

Thanks
 

Здраво

Client
Регистрация
11.07.2011
Сообщения
99
Благодарностей
45
Баллы
18
So is this [SOLVED] then, or not?
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0

CSS

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

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