作者vernc (cralvin)
看板EZsoft
标题[问题] Everything用regexp找档名?
时间Sat Jul 11 01:44:13 2020
\d{3}.\w{3,4}$
想把不符合上面档名的全抓出来,下面这些pass
E:\artnonn\【Electromagnetic Wave(POP)】Unlutin koakumapop\001.jpg
E:\artnonn\【Electromagnetic Wave(POP)】Unlutin koakumapop\002.jpg
E:\artnonn\【Electromagnetic Wave(POP)】Unlutin koakumapop\003.png
E:\artnonn\【Electromagnetic Wave(POP)】Unlutin koakumapop\004.jpg
E:\artnonn\【Electromagnetic Wave(POP)】Unlutin koakumapop\005.jpg
E:\artnonn\【Electromagnetic Wave(POP)】Unlutin koakumapop\006.jpg
只想到
e\:\\artnonn\\.*\\([^\n\\]{4,}|[^\n\\]{0,2})\.\w{3,4}$
但如果像下面就抓不到
E:\artnonn\【Electromagnetic Wave(POP)】Unlutin koakumapop\x01.jpg
E:\artnonn\【Electromagnetic Wave(POP)】Unlutin koakumapop\y1x.jpg
请问这要怎处理?
thx
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.242.4.132 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/EZsoft/M.1594403055.A.A96.html
1F:→ sicao: E\:\\artnonn\\.*\\(?!\d{3}\.\w{3,4}$) ?? 07/11 09:01
2F:→ hsparrot: ! 07/11 12:30
3F:→ sicao: (E\:\\artnonn\\.*\\(?!\d{3}\.\w{3,4}$)).{3}\.\w{3,4}$ 07/13 22:30
4F:→ sicao: (E\:\\artnonn\\.*\\(?!\d{3}\.\w{3,4}$)).{1,}\.\w{3,4}$ 07/13 22:35
5F:→ sicao: 3F是档名必定是三码 4F是档名可以是一到N码 07/13 22:38