-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (21 loc) · 859 Bytes
/
main.cpp
File metadata and controls
31 lines (21 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#define NODEPP_REGEX_ENGINE NODEPP_REGEX_LITE
#include <nodepp/nodepp.h>
using namespace nodepp;
void onMain(){
regex_t address( "(\\w{1,3}::)+" );
console::log( ">>", address.match_all("12::ABCDE::1::ABC::ABCDEGF09").join("-") );
console::log( ">>", address.get_memory().join("-") );
regex_t tpm( "\\w{2,4}-" );
console::log( ">>", tpm.match("abc-") );
regex_t tmp( "\\w{2,4}\\w" );
console::log( ">>", tmp.match("abcde") );
regex_t email( "([@.]?\\w+)+" );
console::log( ">>", email.test("user@mail.example.co.uk") );
console::log( ">>", email.get_memory().join("-") );
regex_t digits(R"(\d+)");
auto numbers = digits.match("Edad: 25 años");
console::log( ">>", numbers );
regex_t spaces(R"(\s+)");
auto result = spaces.replace_all("a b c", " ");
console::log( ">>", result );
}