【发布时间】:2015-01-27 06:24:50
【问题描述】:
我正在尝试构建一组正确识别一组字段类型的正则表达式模式,但无法弄清楚如何让它们全部互斥。这些语法约定似乎总是有足够的重叠,以至于我进行了我不想匹配的匹配。
变量:全部捕获
$字段
$field_with_underscores
标准字段:捕获表格,捕获第一个点之后的所有内容
$table.field
$table.field.subfield
$table.field.subfield_with_underscores
$table.field_with_underscores
$table.field_with_underscores.subfield
$table.field_with_underscores.subfield_with_underscores
自定义字段:捕获表格,捕获c$之后的所有内容
$table.c$字段
$table.c$field_with_underscores
自定义对象系统属性:捕获表,捕获对象,捕获$之后的一切
$table.object$field
$table.object$field_with_underscores
到目前为止,我有以下内容:
变量:工作
^\$[a-zA-Z_]+$
标准字段:不工作,选择自定义对象系统属性
\$([a-zA-Z_]+)\.([^c\$][a-zA-Z_\.]+)[\,]?
自定义字段:工作
\$([a-zA-Z_]+)\.[c]\$([a-zA-Z_]+)
自定义对象系统属性:工作
\$([a-zA-Z_]+)\.(?!c\$)([a-zA-Z_]+)\$([a-zA-Z_]+)
有人可以帮帮我吗?我很快就没有头发可以拔了...:\
【问题讨论】:
-
Custom Object System Attributes是什么意思? -
你是说这个regex101.com/r/bU2zO2/1 吗?
-
自定义对象系统属性是 RightNow 中的一种数据类型。该类型的字符串的格式与我上面显示的一样。您的正则表达式与我要查找的不匹配。
标签: c# regex rightnow-crm