You are here: PSPad forum > English discussion forum > 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!
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>Привет!<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.
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.
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.
Posted by: maki | Date: 2020-01-27 19:16 | IP: IP Logged
<div class=\\"wall_post_text\\">(.*?)<\\/div>
VERY GOOD!!!
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.
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
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
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
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>Привет!<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.
Editor PSPad - freeware editor, © 2001 - 2025 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR