[英]What's the regex pattern for finding code comments starting with an apostrophe or a double slash?
I'm trying to write a language definition for prismjs that will highlight Xojo code. 我正在尝试为Arizonajs编写语言定义,以突出显示Xojo代码。
Comments in Xojo can be any of the following: Xojo中的注释可以是以下任意一项:
' A comment
// Another comment
rem A third comment
Comments can be inline, that is the following is valid: 注释可以是内联的,即以下内容有效:
dim a As Integer // still a comment
There are no multiline comments. 没有多行注释。
So far I have figured out how to highlight comments starting with the apostrophe using this regex pattern: 到目前为止,我已经弄清楚了如何使用此正则表达式模式突出显示以撇号开头的注释:
/'.*/
but I can't figure out the other two. 但我不知道另外两个。 Could anybody help?
有人可以帮忙吗?
Thanks, 谢谢,
这应该可以解决问题:
/('|\/\/|\brem\b).*/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.