Login
|
Signup
langref.org
-
cpp
add..
all
clojure
csharp
erlang
fsharp
groovy
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+/
cpp
C++/CLI .NET 2.0
if (Regex::IsMatch("abc 123 @#$", "\\d+")) Console::WriteLine("ok");
using namespace System;
using namespace System::Text::RegularExpressions;
int main()
{
if (Regex::IsMatch("abc 123 @#$", "\\d+")) Console::WriteLine("ok");
}
Submit a new solution for
cpp
There are 12 other solutions in
additional
languages (
csharp
,
erlang
,
fsharp
,
groovy
...)