sre_constants.error:在位置 2 处多次重复

Rui*_*Rui 6 python regex python-3.x

我试图匹配+和之间的所有子字符串h,例如+abcd1234h.

代码如下:

match = re.match(r'.*+(.*)h.*',line)
Run Code Online (Sandbox Code Playgroud)

当我运行我的代码时,发生如下错误:

File "C:\Program Files\Python\Python36\lib\re.py", line 172, in match
    return _compile(pattern, flags).match(string)

  File "C:\Program Files\Python\Python36\lib\re.py", line 301, in _compile
    p = sre_compile.compile(pattern, flags)

  File "C:\Program Files\Python\Python36\lib\sre_compile.py", line 562, in compi
le
    p = sre_parse.parse(p, flags)

  File "C:\Program Files\Python\Python36\lib\sre_parse.py", line 855, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)

  File "C:\Program Files\Python\Python36\lib\sre_parse.py", line 416, in _parse_
sub
    not nested and not items))

  File "C:\Program Files\Python\Python36\lib\sre_parse.py", line 619, in _parse
    source.tell() - here + len(this))

sre_constants.error: multiple repeat at position 2
Run Code Online (Sandbox Code Playgroud)

好像是正则快递错误,怎么解决?.