View Problem

Check if a string contains a match to a regular expression

Display "ok" if "abc 123 @#$" matches /\d+/
DiskEdit
perl
print "ok" if ("abc 123 @#\$" =~ m/\d+/)
ExpandDiskEdit
cpp C++/CLI .NET 2.0
if (Regex::IsMatch("abc 123 @#$", "\\d+")) Console::WriteLine("ok");
DiskEdit
csharp
if(System.Text.RegularExpressions.Regex.IsMatch("abc 123 @#$",@"\d+")){
Console.WriteLine("ok");
}

Submit a new solution for perl, cpp, or csharp
There are 14 other solutions in additional languages (clojure, erlang, fantom, fsharp ...)