[問題] 文章換行與空白行抓取問題

看板RegExp作者 (sky)時間2年前 (2022/03/18 21:21), 編輯推噓0(003)
留言3則, 2人參與, 1年前最新討論串1/1
Regex規則:「(.*)」 文章: 「Hello World」 「 test test test」 regex101: https://regex101.com/r/pAC4Vz/1 我想要抓取的是文章中「」的內文,不過內文有換行與空白行,導致我抓取不成功, 想請問版上各位是否有方法能夠指導一下呢,謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.34.184.222 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/RegExp/M.1647609672.A.F75.html

03/18 23:37, 2年前 , 1F
「([^」]*)」
03/18 23:37, 1F

03/18 23:39, 2年前 , 2F
用 single line flag (s) 也能讓 . match 換行
03/18 23:39, 2F

06/27 21:24, 1年前 , 3F
06/27 21:24, 3F
文章代碼(AID): #1YD8T8zr (RegExp)