Python regular problem

>>> s=""
>>> c=re.findall("(.*)|.*",s)[0]
>>> c
""
>>> c=re.findall("(.*?)|.*",s)[0]
>>> c
""
>>> c=re.findall("(.*)|.*",s)[0]
>>> c
""
>>> c=re.findall("(.*)\|.*",s)[0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: list index out of range
>>> c=re.findall("(.*)|.*",s)[0]
>>> c
""
>>> 

Why does it always fail to match the number of words before "|"

Mar.21,2021

matches '|' itself is escaped, because it means "or" in the rule. Also match one or more visible characters with . + . A single . can match only one character.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a6a6-2c23d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a6a6-2c23d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?