View Problem

Check if a string contains a match to a regular expression

Display "ok" if "abc 123 @#$" matches /\d+/
ExpandDiskEdit
ruby
puts "ok" if (text=~/\d+/)
DiskEdit
csharp
if(System.Text.RegularExpressions.Regex.IsMatch("abc 123 @#$",@"\d+")){
Console.WriteLine("ok");
}
ExpandDiskEdit
cpp C++/CLI .NET 2.0
if (Regex::IsMatch("abc 123 @#$", "\\d+")) Console::WriteLine("ok");
DiskEdit
clojure
(if (re-find #"\d+" "abc 123 @#$")
(println "ok"))

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