You are here: PSPad forum > English discussion forum > How to combine several regular expressions
Posted by: maki | Date: 2017-10-25 18:30 | IP: IP Logged
How to combine (join) several regular expressions... please help.
1.
Code:
(?:<style.+?>.+?</style>|<script.+?>.+?</script>|<(?:!|/?[a-zA-Z]+).*?/?>)
2.
Code:
(?<=<br>)[^\\\[\]\{\}]*?(?=(</br>|<br>))
3.
Code:
(?<=<p>)[^\\\[\]\{\}]*?(?=(</p>|<p>))
Edited 1 time(s). Last edit at 2017-10-25 18:30 by maki.
Posted by: pspad | Date: 2017-10-25 18:34 | IP: IP Logged
Hello
pipe, the "|" symbol serves as OR operator.
you can use form:
(reg_expr1|reg_expr2|reg_expr3)
delimit all your 3 regular expressions with pipe and enclose with round brackets
Edited 1 time(s). Last edit at 2017-10-25 18:35 by pspad.
Posted by: Andreas | Date: 2017-10-25 21:22 | IP: IP Logged
You also have to escape the slashes you are searching for.
/ => \/
Posted by: maki | Date: 2017-10-25 22:23 | IP: IP Logged
I've tested a lot of regex but never removed 100% of HTML code.
Is there a best way to remove HTML or XHTML and leave only the plain text?
1.
Code: REMOVE
(?:<style.+?>.+?</style>|<script.+?>.+?</script>|<(?:!|/?[a-zA-Z]+).*?/?>)
Here's something to add, change, improve to remove 100% of XHTML or HTML code
2. NOT REMOVE (text)
Code:
(?<=<br>)[^\\\[\]\{\}]*?(?=(</br>|<br>))
3. NOT REMOVE (text)
Code:
(?<=<p>)[^\\\[\]\{\}]*?(?=(</p>|<p>))
like how to remove var code, colors, more script, body and
<a></a> remove
Edited 3 time(s). Last edit at 2017-10-25 22:29 by maki.
Posted by: pspad | Date: 2017-10-25 22:28 | IP: IP Logged
Hello
This is the right question. Yes, use function from the HTML menu - HTML / Conversion / Remove HTML tags.
Posted by: maki | Date: 2017-10-25 22:33 | IP: IP Logged
But I need regex because I want to open "heavy file" in EmEditor 64-BIT (only this program opens big files, or with lots of HTML text)
Posted by: pspad | Date: 2017-10-25 23:02 | IP: IP Logged
Download 64b version of PSPad from developer forum and use function I mentioned in my previous answer
Posted by: maki | Date: 2017-10-26 09:14 | IP: IP Logged
64-bit
Bug 1:
Unable to delete tags in *.log (log file + html).
Not available option.
postimg.org
Bug 2: The Russian text changes
дравŃтвŃĐą, Đ´Ń€ŃĐł, по Ń‚Ń ŃŃ‚ĐľŃ€ĐľĐ˝Ń ŃŤĐşŃ€Đ°Đ˝Đ°.
Bug3:
When try to select text (Bug 2), the text moves!
Edited 3 time(s). Last edit at 2017-10-26 09:16 by maki.
Posted by: pspad | Date: 2017-10-26 12:11 | IP: IP Logged
maki:64-bitBug 1:
Unable to delete tags in *.log (log file + html).
Not available option.
postimg.orgBug 2: The Russian text changes
дравŃтвŃĐą, Đ´Ń€ŃĐł, по Ń‚Ń ŃŃ‚ĐľŃ€ĐľĐ˝Ń ŃŤĐşŃ€Đ°Đ˝Đ°.Bug3:
When try to select text (Bug 2), the text moves!
Hello
For 64b version you need to replace files with 32 b version first and than replace EXE. You will get localized PSPad will all missing functionality
1) It isn't bug. HTML like functions works for HTML based files only. Use menu View / Change syntax and change syntax to HTML. Same you can do with toolbar button or clicking on syntax name on the statusbar.
2) I don't understand. Do you mean after ussage of Remove HTML tag function?
3) How do you select text?
Posted by: maki | Date: 2017-10-26 12:33 | IP: IP Logged
2) Open UTF-8 file or CP-1251 (log file). Text encoding wrong !!!
Please fix this.
3)I want to mark the wrong encodin Note: 2), the text is moving. Very stupid strange bug.
I still do not know how to remove 100% of log code, html and xhtml.
Edited 3 time(s). Last edit at 2017-10-26 12:37 by maki.
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