I have a custom form in admin.
And this is one of my form field
$fieldset->addField(
'price_coefficient',
'text',
[ 'name' => 'price_coefficient',
'label' => __('Price Coefficient'),
'title' => __('Price Coefficient'),
'validation' => ['validate-price-coefficient' => true],
'note' => 'Absolute figure (+8,-3), percentage (+15%, -20%) or Currency rate (1.44)'
]
);
Now I want to add validation to this field with below regular expression.
value.match(/^[+-]?\d+[.]?\d*[%]?$/g);
How this can be done in Magento 2?