Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
regex select, find
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#include <iostream> #include <regex> using namespace std; int main() { string s = "<rule source=\"192.168.10.10:any\" destination=\"any:any\" protocol=\"UDP\"/>"; const regex r(".*\"(.*)\" destination.*"); smatch sm; string result; if (regex_search(s, sm, r)) result = sm[1]; cout << result << endl; // result = "192.168.10.10:any" return 0; }
cl.exe
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 1.87 sec, absolute running time: 0.07 sec, absolute service time: 2.5 sec
edit mode
|
history
|
discussion