简体   繁体   English

如何在 javascript 中为 ExtraFields 制作正则表达式

[英]How can i make regular expression for ExtraFields in javascript

ExtraFields[milage_1][from] ExtraFields[milage_1][to] ExtraFields[milage_1][from] ExtraFields[milage_1][to]

ExtraFields[model_year_example_1998_2001_0][from]

ExtraFields[model_year_example_1998_2001_0][to]

This is the values i just want to check for Extrafields and [from] .这是我只想检查Extrafields and [from]

i.match(/^ExtraFields.*[f.*.m]/g)

but it pass through for both [from] and [to] and i want to only make true if there is [from] only.但它通过 [from] 和 [to] 并且我只想在只有 [from] 时才为真。

我所做的是删除[f.*.m]括号这对我/^ExtraFields.*f.*.m/g

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM