You are here: PSPad forum > English discussion forum > div class tag regex issue

div class tag regex issue

Goto Page: Previous1 2 3 Next

#11 Re: div class tag regex issue

Posted by: pspad | Date: 2020-01-27 19:04 | IP: IP Logged

I don't matter of text between tags, but tags in example was different from the real tags. This has nothing with data inside!

Options: Reply | Quote | Up ^


#12 Re: div class tag regex issue

Posted by: maki | Date: 2020-01-27 19:05 | IP: IP Logged

<div class=\\"wall_post_text\\">(.*)<\\/div>

<\\/div> A small bug.
It can occur only once per line.

<\\/div> (one corect)

..........<\\/div> baaxs<\\/div> (two or more wrong!)

(start!)<div class=\"wall_post_text\"><a href=\"\/feed?section=search&q=%23%D0%91%D0%9F_%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D1%8F\">#БП_Россия<\/a><br><br>Привет&#33;<br>Меня деле.<br>Больше всего я люблю учиться,путетвовать и учить языки. В собеседнике ищу желание переписываться и только. Мы вместе учить языки,рассказывать о своих будх, дискутировать на проблемные темы и все что ты захочешь.<br>Адрес дам в лс.<\/div>(END!)blabla bl<\/div>....ssc <===wrong, NO MORE CODE MATCH!!

Edited 4 time(s). Last edit at 2020-01-27 19:09 by maki.

Options: Reply | Quote | Up ^


#13 Re: div class tag regex issue

Posted by: pspad | Date: 2020-01-27 19:09 | IP: IP Logged

So you want to extract text only till first <\/div> and ignore the rest?
Use this:
<div class=\\"wall_post_text\\">(.*?)<\\/div>

Edited 1 time(s). Last edit at 2020-01-27 19:10 by pspad.

Options: Reply | Quote | Up ^


#14 Re: div class tag regex issue

Posted by: maki | Date: 2020-01-27 19:13 | IP: IP Logged

<div class=\"wall_post_text\"><a href=\"\/feed?....................<\/div>There must be an ending here if this tag occurs, don't grab any more code.

<\/div>
Regex:
{n,m} n through

???

Edited 1 time(s). Last edit at 2020-01-27 19:14 by maki.

Options: Reply | Quote | Up ^


#15 Re: div class tag regex issue

Posted by: maki | Date: 2020-01-27 19:16 | IP: IP Logged

<div class=\\"wall_post_text\\">(.*?)<\\/div>

VERY GOOD!!!

Options: Reply | Quote | Up ^


#16 Re: div class tag regex issue

Posted by: maki | Date: 2020-01-27 19:31 | IP: IP Logged

Now. First task completed. Now the second task is waiting

How to replace many of these similar lines now so that normal HTML can be displayed in the browser?

Edited 1 time(s). Last edit at 2020-01-27 19:32 by maki.

Options: Reply | Quote | Up ^


#17 Re: div class tag regex issue

Posted by: pspad | Date: 2020-01-27 19:43 | IP: IP Logged

Save your file as something.html
select all your lines and insert (alt+I) on the end of each line: <br>
Put on the begin:
<html>
<body>

Put on the end:
</body>
</html>

Or use function Text To HTML from the HTML menu / Conversion.
Highlighter must be set e.g. to HTML

Options: Reply | Quote | Up ^


#18 Re: div class tag regex issue

Posted by: maki | Date: 2020-01-27 20:08 | IP: IP Logged

Errors occur because many texts have been replaced as a hyperlink.

a href merges with the text

Options: Reply | Quote | Up ^


#19 Re: div class tag regex issue

Posted by: pspad | Date: 2020-01-27 20:12 | IP: IP Logged

maki:
Errors occur because many texts have been replaced as a hyperlink.

a href merges with the text

Thank you for useless information.
Do you realize that you have not provided the only information again, what is the text in the lines, what you want to do about it, and you just write that there was an error.
Sorry, I must do some serious work

Options: Reply | Quote | Up ^


#20 Re: div class tag regex issue

Posted by: maki | Date: 2020-01-27 20:27 | IP: IP Logged

<html>
<body>
<div class=\"wall_post_text\"><a href=\"\/feed?section=search&q=%23%D0%91%D0%9F_%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D1%8F\">#БП_Россия<\/a><br><br>Привет&#33;<br>Меня деле.<br>Больше всего я люблю учиться,путетвовать и учить языки. В собеседнике ищу желание переписываться и только. Мы вместе учить языки,рассказывать о своих будх, дискутировать на проблемные темы и все что ты захочешь.<br>Адрес дам в лс.<\/div><br>
</body>
</html>

Save As.. HTML

Wrong Text=Hyper Link

Edited 2 time(s). Last edit at 2020-01-27 20:28 by maki.

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3 Next





Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR