我有一个组件,该组件具有input {
http_poller {
urls => {
test1 => {
# Supports all options supported by ruby's Manticore HTTP client
method => get
url => "http://url/metrics/currentUser/metrics"
headers => {
Accept => "application/json"
}
}
}
request_timeout => 29
schedule => { cron => "* * * * * UTC"}
codec => "json"
}
}
filter {
json {
source => "timers"
target => "timers"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "final"
}
stdout { }
}
装饰器。因此,我正在尝试在其中设置正则表达式。
像
@input()
或
<component [regex]="/^\d+$/" ></component>
但这没用
答案 0 :(得分:0)
您可以将RegEx作为字符串值传递,例如
<component [regex]="'^\d+$'"></component>
或
<component regex="^\d+$"></component>
然后在组件中,您可以使用new RegExp(this.regex);
创建实际的正则表达式对象