Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Day-02 03-regex-match.py #39

Open
pramod-199 opened this issue Apr 3, 2024 · 1 comment
Open

Python Day-02 03-regex-match.py #39

pramod-199 opened this issue Apr 3, 2024 · 1 comment

Comments

@pramod-199
Copy link

03-regex-match.py please check this file as im getting error of match not found mybe match only checks at the starting of string

@pramod-199
Copy link
Author

it should be like

import re

text = "quick brown fox"
pattern = r"quick"

match = re.match(pattern, text)
if match:
print("Match found:", match.group())
else:
print("No match")

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

No branches or pull requests

1 participant