Login
|
Signup
langref.org
-
groovy
add..
all
clojure
cpp
csharp
erlang
fantom
fsharp
go
haskell
java
ocaml
perl
php
python
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Regex
Searching
Check if a string contains a match to a regular expression
Display
"ok"
if
"abc 123 @#$"
matches
/\d+/
groovy
if ('abc 123 @#$' =~ /\d+/) println 'ok'
if ('abc 123 @#$' =~ /\d+/) println 'ok'
groovy
1.6.1+
if ('abc 123 @#$'.find(/\d+/)) println 'ok'
if ('abc 123 @#$'.find(/\d+/)) println 'ok'
Submit a new solution for
groovy
There are 15 other solutions in
additional
languages (
clojure
,
cpp
,
csharp
,
erlang
...)