Skip to content

Why does this regex for a comment Terminal not work? #1361

Answered by MegaIng
nchammas asked this question in Q&A
Discussion options

You must be logged in to vote

$ matches the end of the string by default. If you want it to match the end of the line, add the m flag. /#.*$/m. This is clearly documented in the python regex docs.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nchammas
Comment options

Answer selected by nchammas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants