biati-digital / nova-text-tools

Swiss Army knife for text manipulation and selection Sort, Transform, Filter, Delete Duplicates, Encode, Decode and much more...
16 stars 2 forks source link

Support for regex common character classes (metacharacters) #3

Closed melvinabundo closed 2 years ago

melvinabundo commented 2 years ago

It took a while swamping through my own self-doubt, but I realize that Text Tools supports only ^, $, and ! for matching lines. Did I get that right? Are there plans to match the power of mvoidex's SublimeSelectByRegex?

Love what you guys are doing, thanks for the plugin. I don't want to have a lot of plugins for text manipulation; you guys get me.

biati-digital commented 2 years ago

Hi @melvinabundo sorry about that, we just had a few hours to create the extension. Regex support was planned but we quickly find out that it will require more time and tests so we decided to leave it for later as we have some client projects that we need to finish first but definitely the idea is to make it work like the extension you mention (except the "update selections" as you type, that's really cool but not possible with the current Nova API)

We totally get you and we're really happy you find it useful.

biati-digital commented 2 years ago

This has been improved in the latest version (2.0.0) now you can use regex to filter or select

class Foo(object):
    def some(self, arg):
        self.bar = arg
        self.baz = arg + self.smth

    def on_done(self, rx):
        self.view = x

    def on_change(self, rx):
        self.view = x

for example you can use Select Ocurrences Matching... and enter def (\w+)\(self, rx\) and will select on_done and on_change

We'll keep working to improve this so try it and let us know what you think.

melvinabundo commented 2 years ago

Thank you for the speedy reply and fast fix. That was amazing. Tested the following on a plain text file of about 1000 lines. Works great!

Metacharacters

. \ \w \n \d \s \D \S \W

Operators

* + ? {n} {n,m}

Match lines only, not ocurrences

^ $

Harmless quirk: If the word "false" is in the text, invalid statements like ^^ end up selecting all occurences of the word "false"

melvinabundo commented 2 years ago

(except the "update selections" as you type, that's really cool but not possible with the current Nova API)

Also just pointing out your appreciation for good features. That's pure stuff. More power to you, Text Tools no.1!