mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-21 06:15:15 +00:00
Support exponential syntax in number and percentage regular expression.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
let percentReg = /^(-?\d+(?:\.\d+)?)(%?)$/;
|
let percentReg = /^([+\-]?\d+(?:\.\d+)?(?:[eE][+\-]?\d+)?)(%?)$/;
|
||||||
export default function (percent) {
|
export default function (percent) {
|
||||||
let matched = percent.match(percentReg);
|
let matched = percent.match(percentReg);
|
||||||
if (!matched) {
|
if (!matched) {
|
||||||
|
|||||||
Reference in New Issue
Block a user