【发布时间】:2017-01-18 00:06:04
【问题描述】:
我正在尝试从以下内容中提取 {THIS_PATTERN} 之类的模式:
.intro-header {
padding-top: 50px; /* If you're making other pages, make sure there is 50px of padding to make sure the navbar doesn't overlap content! */
padding-bottom: 50px;
text-align: center;
color: #f8f8f8;
background: url(../img/{BG_IMAGE_0}) no-repeat center center;
background-size: cover;
}
在这种情况下,它将是{BG_IMAGE_0}。
我不知道我的正则表达式出了什么问题:\{[A-Z_]*\}
我在这里有一个 regex101 小提琴: https://regex101.com/r/KF5Sz6/2
【问题讨论】:
-
你错过了“数字”
\{[A-Z_\d]*\}
标签: regex