mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
git-svn-id: svn://ultimatepp.org/upp/trunk@332 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
6842990fa9
commit
2667dfc1d5
385 changed files with 188873 additions and 2 deletions
25
uppbox/PcreTest/PcreTest.cpp
Normal file
25
uppbox/PcreTest/PcreTest.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <Core/Core.h>
|
||||
#include <Plugin/Pcre/Pcre.h>
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
RegExp r0("(\\w+)\\s(\\w+)\\s(\\w+)");
|
||||
if(r0.Match("one two three"))
|
||||
{
|
||||
for(int i = 0; i < r0.GetCount(); i++)
|
||||
Cout() << r0[i] << '\n';
|
||||
} else if(r0.IsError())
|
||||
Cout() << r0.GetError() << '\n';
|
||||
|
||||
Cout() << "------------------------------\n";
|
||||
|
||||
RegExp r1("(\\w+)", RegExp::UNICODE);
|
||||
int i = 0;
|
||||
while(r1.GlobalMatch("hello 4 ho 55 uuu iii pp 99 baby too swistak"))
|
||||
{
|
||||
for(int i = 0; i < r1.GetCount(); i++)
|
||||
Cout() << r1[i] << '\n';
|
||||
}
|
||||
if(r1.IsError())
|
||||
Cout() << r1.GetError() << '\n';
|
||||
}
|
||||
9
uppbox/PcreTest/PcreTest.upp
Normal file
9
uppbox/PcreTest/PcreTest.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core,
|
||||
Pcre;
|
||||
|
||||
file
|
||||
PcreTest.cpp charset "UTF-8";
|
||||
|
||||
mainconfig
|
||||
"" = "CONSOLE";
|
||||
Loading…
Add table
Add a link
Reference in a new issue