Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
"\\d+(,\\d+)?"
Zu deinem Regex: ^ bedeutet nicht, das heißt du suchst derzeit nach allem außer Ziffern
^\d+(,\d+)?$
^[0-9]+(,[0-9]+)?$
using System;
using System.Text.RegularExpressions;
class Program {
static void Main(string[] argv) {
Regex rx;
rx = new Regex(@"\d+(,\d+)?");
//True
Console.WriteLine(rx.IsMatch("foo1,5bar"));
rx = new Regex(@"^\d+(,\d+)?$"); //= new Regex(@"^[0-9]+(,[0-9]+)?$")
//False
Console.WriteLine(rx.IsMatch("foo1,5bar"));
//True
Console.WriteLine(rx.IsMatch("1,5"));
}
}