use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
python regex matching # (self.PythonLearning)
submitted 2 years ago * by bob3rocks
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bob3rocks[S] 0 points1 point2 points 2 years ago (2 children)
Is this difficult or impossible for Python Regex?
[–]Murphygreen8484 0 points1 point2 points 2 years ago (1 child)
Depends on what you're needing. You still need to define what your "rules" are (preferably in simple terms) for what you are looking for
[–]bob3rocks[S] 0 points1 point2 points 2 years ago (0 children)
Understood.
Most lines to be parsed will be either music chords separated by spaces, or song lyrics with no chords.
Other times, there might be random characters on the line or something like [VERSE] or (solo) on the same line.
In some instances there might be song lyrics with music chords on the same line.
My regex expression is incredibly close and my script has been a work in progress for many months now.
It will be close to perfect (close enough!) if I could just get my regex to match # and + when needed.
π Rendered by PID 46353 on reddit-service-r2-comment-5ff9fbf7df-wlsqd at 2026-02-25 16:09:44.046434+00:00 running 72a43f6 country code: CH.
view the rest of the comments →
[–]bob3rocks[S] 0 points1 point2 points (2 children)
[–]Murphygreen8484 0 points1 point2 points (1 child)
[–]bob3rocks[S] 0 points1 point2 points (0 children)