Skip to content

řešení úkolů - regulární výrazy#62

Closed
DagyDee wants to merge 1 commit intoPyLadiesCZ-Brno:mainfrom
DagyDee:ukoly-regularni-vyrazy
Closed

řešení úkolů - regulární výrazy#62
DagyDee wants to merge 1 commit intoPyLadiesCZ-Brno:mainfrom
DagyDee:ukoly-regularni-vyrazy

Conversation

@DagyDee
Copy link
Contributor

@DagyDee DagyDee commented Apr 28, 2025

řešení úkolů v sekci 'Regulární výrazy v Pythonu'

řešení úkolů v sekci 'Regulární výrazy v Pythonu'
@DagyDee
Copy link
Contributor Author

DagyDee commented Apr 28, 2025

@ZelenyMartin prosím o kontrolu úkolů.
šla jsem podle návodu na odevzdávání úkolů, ale nevím, jak udělat 'pull request' do větve 'reseni'

@@ -0,0 +1,10 @@
import re

regularni_vyraz = re.compile(r"\w+\.?\w+@\w+\.cz")
Copy link
Contributor

Choose a reason for hiding this comment

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

Tady ten regexp bude vyžadovat minimálně 2 znaky před zavináčem (mezi kterými může nebo nemusí být tečka). Jinak super.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ZelenyMartin
Opravený regulární výraz: r"(\w+.)?\w+@\w+.cz"
Takhle je to OK?

Copy link
Contributor

Choose a reason for hiding this comment

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

Jo. V pohodě.


ip_adresa = input("Zadejte IP adresu: ")

rv = re.compile(r"([1-2]?\d?\d\.){3}[1-2]?\d?\d")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
rv = re.compile(r"([1-2]?\d?\d\.){3}[1-2]?\d?\d")
rv = re.compile(r"([12]?\d?\d\.){3}[12]?\d?\d")

Mělo byt fungovat i takto. Celkově vynikající!

@ZelenyMartin
Copy link
Contributor

Výborné řešení. Jen to musím zavřít, protože to nemůžu zamergovat do hlavního repa.

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.

2 participants