You are here: PSPad forum > English discussion forum > show matching brackets inside strings

show matching brackets inside strings

#1 show matching brackets inside strings

Posted by: idefix2 | Date: 2021-07-01 13:22 | IP: IP Logged

In my programs, I make extensive use of regular expressions. These are string constants most of the time, very often with MANY nested parentheses, and it would very helpful, if for parentheses inside a string the matching counterpart would be highlighted in the same way as outside a string, maybe even in another string, like
rgx:="^(abc" . variable . "xyz)".
Here, the opening parenthis before abc matches the closing parenthesis after xyz in the next string.

However, parentheses inside strings should be matched separately from parentheses outside strings. There can never be a match between the two types, and sometimes, there may be isolated parentheses inside strings which would disturb the matching of parentheses in the rest of the program.

Options: Reply | Quote | Up ^


#2 Re: show matching brackets inside strings

Posted by: pspad | Date: 2021-07-01 17:12 | IP: IP Logged

There is little difference.
Backet outside of string is a symbol, bracket inside string is simple another char in string. Another problem with regular expressions are escaped brackets, some expression inside strings what are executed e.t.c. I can't imagine how should be able to evaluate all eventualities to find matching bracket.

Options: Reply | Quote | Up ^


#3 Re: show matching brackets inside strings

Posted by: idefix2 | Date: 2021-07-02 10:28 | IP: IP Logged

Not absolutely perfect would still be (much) better than nothing. I know that if you want to have a perfect solution (for regex), that would be very complicated, and certainly not woth the effort. And not every string is a regex...

It would still be helpful if you could match opening and closing brackets of all types that occur within strings. If it's an escaped bracket, the display may not reflect the real matching, but those will be exceptions. I am not looking for magic smiling smiley

Quote:
Bracket outside of string is a symbol, bracket inside string is simple another char in string.

I understand that the internal pspad code for matching brackets inside of strings would be different than the code that matches the brackets outside.

Edited 1 time(s). Last edit at 2021-07-02 10:28 by idefix2.

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