I am trying to write a regular expression that matches lines beginning with a hyphen (-) OR that begins with spaces or tabs and then has a hyphen. So it should match the followi
the above (using \s*) is the easiest one for this case, but in general, you can always use the | syntax:
re.match('^-|^\s+-', '- hello')
<_sre.SRE_Match object at 0x0000000054E72030>
re.match('^-|^\s+-', ' - hello')
<_sre.SRE_Match object at 0x0000000054E72030>
re.match('^-|^\s+-', ' + hello')
None
^-
is the case for - at beginning, `^\s+-' is with one or more spaces, and | chooses either one.