Skip to content

Commit 90ce08c

Browse files
committed
numberパラメータであることをチェックする正規表現を修正。空文字はエラーとする。
1 parent 0421304 commit 90ce08c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dConnectSDK/dConnectSDKForIOS/DConnectSDK/Classes/profile/spec/DConnectSpecConstants.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ + (BOOL)isDigit:(NSString *)text {
291291
}
292292

293293
+ (BOOL)isNumber:(NSString *)text {
294-
NSString *expression = @"^[-+]?([0-9]*)?(\\.)?([0-9]*)?$";
294+
NSString *expression = @"^[-+]?([0-9]+)((\\.)[0-9]+)?$";
295295
NSError *error = nil;
296296

297297
NSRegularExpression *regex =

0 commit comments

Comments
 (0)