Regular expression syntax for “match nothing”?

前端 未结 6 918
清酒与你
清酒与你 2021-01-31 00:58

I have a python template engine that heavily uses regexp. It uses concatenation like:

re.compile( regexp1 + \"|\" + regexp2 + \"*|\" + regexp3 + \"+\" )
<         


        
6条回答
  •  说谎
    说谎 (楼主)
    2021-01-31 01:48

    You could use
    \z..
    This is the absolute end of string, followed by two of anything

    If + or * is tacked on the end this still works refusing to match anything

提交回复
热议问题