You are here: PSPad forum > English discussion forum > Re: perl brackets match
Posted by: massimobalestra | Date: 2015-12-09 02:08 | IP: IP Logged
Hi,
sometimes the matching bracket (ctrl+M) does not work as expected in perl syntax highlighting, when the bracket is inside a regular expression and it is escaped.
This is the example
if ($condition) {
if ($userData =~ /^\{/) {
$some_code_here;
}
}
(Basically I want to check if in the variable $userData there is a json data structure so I check if it starts with { ; I could do in other ways but this example shows this little bug in psPad ).
The curly bracket inside the regular expression is escaped but psPad matches it with the last one inthe 5th row.
The opened curly bracket after if ($condition) does not find any match (it is shown in red).
Probably it does something similar also with other brackets but I don't have an example ready right now.
Is there anything you can do?
Thanks
Massimo
Posted by: massimobalestra | Date: 2015-12-13 15:06 | IP: IP Logged
Jan,
Did you have any time to take a look at this problem?
Thanks
Posted by: massimobalestra | Date: 2016-12-02 19:20 | IP: IP Logged
Do you have time to look also at this bug?
Thanks
Posted by: arogl | Date: 2017-07-29 12:07 | IP: IP Logged
The bracket match also does not work for this MSDOS Batch code snippet
if /I "%1" EQU "all" (
for %%c in ( ___ ) do (
cd /d %%c
for %%b in ( _____ ) do (
for /R %%a in ( "*.%%b" ) do (
copy "%%a" "%%~pna.mp4" && del "%%a"
)
)
)
)
I have tried this with the 4.6.2(2750) release and 5.0.0(235) beta.
Edited 1 time(s). Last edit at 2017-07-29 12:14 by pspad.
Posted by: pspad | Date: 2017-07-29 12:14 | IP: IP Logged
Thank you for report
Posted by: pspad | Date: 2017-08-10 10:38 | IP: IP Logged
Problem with Batch highlight was fixed
Posted by: arogl | Date: 2017-08-12 01:51 | IP: IP Logged
Tested in 5.0.0 (241) and worked.
Thanks for your hard work on pspad.
Posted by: massimobalestra | Date: 2017-10-30 15:54 | IP: IP Logged
I just tested in PsPad 5.0.0 (251) and the problem is still there.
Note: the syntax highlight I am using is perl
Posted by: massimobalestra | Date: 2017-11-06 19:02 | IP: IP Logged
I have another example of braces matching malfunctioning.
It is always in perl:
if ($needSpecialCharacters) {
print
"You Need special characters.\n" .
"Special Characters are:\n" .
q {` ~ ! @ # $ % ^ & * ( ) _ - + = \ | [ ] { } ' " ; : / ? . < > , } .
"Please enter at least one of them\n\n";
}
The Curly braces at the end of the if, in psPad, matches with the one after the q.
the q{} in perl means quote so everything inside is be considered a text as it is without interpretation.
It is still not working.
I have PsPad 5.0.0 (251)
Thanks
Posted by: pspad | Date: 2017-11-06 19:50 | IP: IP Logged
Thank you for the example
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