尝试了如下regex,好像还是不行。求助高手!# this is comment 1
# this is comment 2
# this is comment n
variable <- 123
Code: Select all
^(?<!#)(.+?)$
Moderators: tmplinshi, arcticir
尝试了如下regex,好像还是不行。求助高手!# this is comment 1
# this is comment 2
# this is comment n
variable <- 123
Code: Select all
^(?<!#)(.+?)$
Code: Select all
str =
(
# this is comment 1
# this is comment 2
# this is comment n
variable <- 123
)
RegExMatch(str, "`am)^(?!#).+$", match)
MsgBox, % match
RegExMatch(str, "`am)^[^#]+$", match)
MsgBox, % match
tmplinshi wrote: ↑10 Jul 2020, 20:34`a 识别任何形式的换行, 比如 `r, `n, `r`nCode: Select all
str = ( # this is comment 1 # this is comment 2 # this is comment n variable <- 123 ) RegExMatch(str, "`am)^(?!#).+$", match) MsgBox, % match RegExMatch(str, "`am)^[^#]+$", match) MsgBox, % match
m 表示只匹配单行