Skip to content

Add support for boundaryless regex#86

Merged
bee-san merged 15 commits intomainfrom
unknown repository
Jul 2, 2021
Merged

Add support for boundaryless regex#86
bee-san merged 15 commits intomainfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jun 17, 2021

ToDo:

  • Add Filter class
  • Write tests for Filter class
  • Add suport for boundaryless regex using Filter class
  • Write some more tests
  • Update README
  • Update CLI
  • Add flag that disables boundaryless
  • Replace re.search()

@ghost
Copy link
Copy Markdown
Author

ghost commented Jun 17, 2021

So far, I have added a Filter class. It behaves just like the Distribution class, although it does not store regexes.
Now, you can initialize Distribution using either another Distribution, a Filter or a filters_dict. The same applies to the Filter class.

@bee-san
Copy link
Copy Markdown
Owner

bee-san commented Jun 17, 2021

This is huge!!!!!!!!!!!!!

@bee-san
Copy link
Copy Markdown
Owner

bee-san commented Jun 27, 2021

forgot to say maybe, but this should integrate with filter system so you can filter say:

only have boundaries on regex below 1.0 rarity etc :))

@ghost
Copy link
Copy Markdown
Author

ghost commented Jun 27, 2021

forgot to say maybe, but this should integrate with filter system so you can filter say:

only have boundaries on regex below 1.0 rarity etc :))

This one is already done.

@bee-san
Copy link
Copy Markdown
Owner

bee-san commented Jun 29, 2021

README left 😱

Copy link
Copy Markdown
Owner

@bee-san bee-san left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some great stuff 🔥

pywhat/what.py Outdated
@click.option(
"-br",
"--boundaryless-rarity",
help="Same as --rarity but for boundaryless.",
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we just use --rarity for this? :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because --rarity is used for filtration purposes and disables/enables regex fully, while --boundaryless-rarity disables/enables boundaryless mode

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make that clear in the help menu somehow? :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it clear now?

"-be", "--boundaryless-exclude", help="Same as --exclude but for boundaryless."
)
@click.option(
"-db", "--disable-boundaryless", is_flag=True, help="Disable boundaryless mode."
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

help="Disable boundaryless mode, allows you to search within strings"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm, '-db' does not allow to search within strings🥲

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what it does?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disables boundaryless mode so inputs like jgakljgd127.0.0.1jfl will not match

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added an explanation of what boundaryless mode is to --help

@click.option(
"-be", "--boundaryless-exclude", help="Same as --exclude but for boundaryless."
)
@click.option(
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is boundaryless on by default?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in CLI with rarity 0.1:1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI breaking change! 🔥

@ghost
Copy link
Copy Markdown
Author

ghost commented Jun 30, 2021

Breaking CLI changes btw

@ghost
Copy link
Copy Markdown
Author

ghost commented Jun 30, 2021

API docs left🚀

@ghost ghost linked an issue Jun 30, 2021 that may be closed by this pull request
@ghost
Copy link
Copy Markdown
Author

ghost commented Jul 1, 2021

Finally, API docs are updated

@bee-san
Copy link
Copy Markdown
Owner

bee-san commented Jul 1, 2021

Let me review and then merge :)))

Copy link
Copy Markdown
Owner

@bee-san bee-san left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than my comments :)

@click.option(
"-be", "--boundaryless-exclude", help="Same as --exclude but for boundaryless."
)
@click.option(
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI breaking change! 🔥

@bee-san bee-san merged commit d89746a into bee-san:main Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Look at making regex "search within strings" by not having boundaries

3 participants