user6223604
user6223604

Reputation:

How to get lines matched to special regex

I want to get all lines which :

or

i get all lines which begin with '- ' by r"^- .*" and all lines which contains '=' or '<' or '>' by .*[=<>] but i don't know how to combine the expression.

You find my example here: https://regex101.com/r/pUk3qM/4/

Upvotes: 0

Views: 40

Answers (1)

David Amar
David Amar

Reputation: 257

You can use (^- |[=<>]) if you don't care about the match - just need to know whether the whole line matches or not.

If you actually do need to match the whole line, you can use ^(- |.*[=<>]).*$ instead

Upvotes: 1

Related Questions