GreedyBear icon indicating copy to clipboard operation
GreedyBear copied to clipboard

Regular expressions in `consts.py`

Open regulartim opened this issue 2 months ago • 7 comments

There are 3 regular expressions in consts.py:

REGEX_DOMAIN = r"^[a-zA-Z\d-]{1,60}(\.[a-zA-Z\d-]{1,60})*$"
REGEX_IP = r"^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$"
REGEX_PASSWORD = r"^(?=.*[a-zA-Z])\S{12,}$"

This is confusing, as there is a separate place for regexes: regex.py.

Someone should:

  • check if these 3 regexes are actually used
  • remove them or move them to regex.py
  • if REGEX_IP is actually used, it should also match v6 addresses

Related: #857

regulartim avatar Oct 05 '26 14:10 regulartim

Should I consider working on this myself , or check if any newcomer wants to collaborate..? as its good first issue!

AdeshDeshmukh avatar Oct 05 '26 15:10 AdeshDeshmukh

Hey @AdeshDeshmukh ! When your current PR is merged, I can assign you. Or you can pick something else and leave this for a new contributor.

regulartim avatar Oct 05 '26 17:10 regulartim

is this open? @regulartim ?

Demiserular avatar Oct 06 '26 11:10 Demiserular

Hi @Demiserular . Yes, it is. But you are already assigned to a different issue.

regulartim avatar Oct 06 '26 11:10 regulartim

Hi @regulartim, I am new to the repository and would like to take this up as my first issue. Could you please assign it to me?

Izhaan60 avatar Oct 07 '26 19:10 Izhaan60

Hi @Izhaan60 ! Sure, this is a good issue to start with! :)

regulartim avatar Oct 08 '26 12:10 regulartim

Hi @regulartim, I saw your message on PR #1712. I'd like to pick this up. My plan is to move the regex constants from consts.py to regex.py and apply the ruff check . --fix and # noqa: S105 fixes to get it clean. Can I be assigned?

zcosmicw avatar Oct 27 '26 10:10 zcosmicw