Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Python: Find matched line by regular expression for lines of Strings

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

No repository file or documentation location is identified; start by finding where Python tips are maintained and reviewing similar entries. Check the example against values.yaml and the intended regular-expression group lookup. Done means the tip has a clear location, corrected example, and a verifiable explanation of the returned line and match.

Written by the indexing model from the issue text.

Description

import re

##find first match line, and matched group by group number with lines of strings
def find_match_line(r, lines, groupNo=0):
for line in lines:
match = r.search(line)
if match:
return line, match.group(groupNo)
return None, None

###find the "repository:" line in helm file values.yaml, and get the matched repos name
with open("values.yaml", 'r') as file:
lines = file.readlines()
repo_reg = re.compile(r'repository:[ ]' + repos_prefix + "/([a-zA-Z-])")
_,matched_repo_name = find_match_line(repo_reg, lines, 1)
if matched_repos_name:
print("matched repos:%s" % matched_repos_name)

Dominant language
Python
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from davideuler/programming-tips

All issues in davideuler/programming-tips

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.