"foo = '@test.bar';\nfooa = @test.darn;".match(/@([a-z][a-z\.-_]*)/igm)
Run Code Online (Sandbox Code Playgroud)
为什么这匹配
["@test.bar", "@test.darn;"]
Run Code Online (Sandbox Code Playgroud)
而不仅仅是
["@test.bar", "@test.darn"]
Run Code Online (Sandbox Code Playgroud)
?