You are here: PSPad forum > English discussion forum > Re: Bug? Regex breaks PHP Code Highlighting

Re: Bug? Regex breaks PHP Code Highlighting

#1 Bug? Regex breaks PHP Code Highlighting

Posted by: jask | Date: 2013-04-18 14:03 | IP: IP Logged

Hi,

I have this (working) Regex that kills all kinds of empty <p> Tags in my Output, Unfortunately in my PSPad this breaks the PHP Hightlighting. Everything after the regex ist just black text. Can anyone confirm this? Any workaround?

'#<p>(\s|&nbsp;|</?\s?br\s?/?>)*</?p>#'

Thanks

Options: Reply | Quote | Up ^


#2 Re: Bug? Regex breaks PHP Code Highlighting

Posted by: myf | Date: 2013-04-18 18:19 | IP: IP Logged

Yup, it does in HTML Multihighlighter

<?php
var $a = '#<p>(\s|&nbsp;|</?\s?br\s?/?>)*</?p>#';
var $b = $a;
?>

image
the "?>" ends PHP block for PSPad and returns to HTML, so "hotfix" could be anything what prevents occurence of such string, eg
image

… or you if it is plain PHP file, use PHP highlighter instead and you may leave source intact.

Edited 1 time(s). Last edit at 2013-04-18 18:28 by myf.

Options: Reply | Quote | Up ^


#3 Re: Bug? Regex breaks PHP Code Highlighting

Posted by: carbonize | Date: 2013-04-18 20:21 | IP: IP Logged

It's a known issue with HTML Multihighlighter. As myf says switch to just PHP highlighting.

--
Carbonize

Options: Reply | Quote | Up ^


#4 Re: Bug? Regex breaks PHP Code Highlighting

Posted by: jask | Date: 2013-04-24 13:26 | IP: IP Logged

Well, that was easy, switched to PHP Hightling and everything's fine. Thanks guys.

Options: Reply | Quote | Up ^






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