View Problem

Check if a string contains a match to a regular expression

Display "ok" if "abc 123 @#$" matches /\d+/
DiskEdit
python
found = re.search(r'\d+', 'abc 123 @#$')
if found:
print 'ok'
DiskEdit
clojure
(if (re-find #"\d+" "abc 123 @#$")
(println "ok"))
DiskEdit
csharp
if(System.Text.RegularExpressions.Regex.IsMatch("abc 123 @#$",@"\d+")){
Console.WriteLine("ok");
}

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