gman
07/26/2020, 12:57 PMs/someFuncName(?open()(.?)(?close)(?open{)(.*?)(?close)/balbalbal(\1){\2}/
or something to that effect where (?open<char>)
means start a language aware match for <char> (ps: I get that search and replace above is boring but I can't count the times I've wanted to be able to grab the content of a function or a code block in a regex but couldn't. Usually I got around it with keyboard macros which sometimes is a win and sometimes a lose.
Most old text editors just edit based on text and nothing else. Slickedit, the editor I used most of my life until recently, has the ability to search based on the its colorization engine meaning that given the fact that it knows a string from a comment from code for coloring differently you could search/replace for things only in comments or only in strings etc... But it didn't have any kind of language aware bracket matching patterns added to its regex language.
At the moment that seems like a ridiculously obvious enhancement to a text editor but it requires the editor to be able to parse the language and somehow combine that knowledge with its regex engine.Kartik Agaram
Ray Imber
07/26/2020, 7:10 PMGarth Goldwater
07/26/2020, 8:23 PMGarth Goldwater
07/26/2020, 8:24 PMgman
07/27/2020, 7:23 AMJack Rusher
07/27/2020, 11:23 AMexpand-region
-like functions to get something like what you're talking about above. This would not be integrated into the grammar of regular expressions, though, so you would need to write a few more lines of elisp to get the behavior I think you're after.gman
07/30/2020, 9:05 AMRay Imber
07/30/2020, 5:09 PM