作者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/m.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