I have some data that look like thisjohn, dave, chrisrick, sam, bobjoe, milt, paulI'm using this regex to match the names/(\w.+?)(\r\n|\n|,)/which works for the most part but the file ends abruptly after the last word meaning the last value doesn't end in \r\n, \n or , it ends with EOF. Is there a way to match EOF in regex so I can put it right in that second grouping? 解决方案 The answer to this question is \Z took me awhile to figure it out, but it works now. Note that conversely, \A matches beginning of the whole string (as opposed to ^ and $ matching the beginning of one line). 这篇关于正则表达式匹配EOF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-11 13:20