mirror of
https://github.com/lsdlsd88/JC4827W543.git
synced 2026-05-05 00:20:13 +01:00
initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include <Regexp.h>
|
||||
|
||||
void setup ()
|
||||
{
|
||||
Serial.begin (115200);
|
||||
|
||||
// match state object
|
||||
MatchState ms;
|
||||
|
||||
// what we are searching (the target)
|
||||
char buf [100] = "The quick brown fox jumps over the lazy wolf";
|
||||
ms.Target (buf); // set its address
|
||||
Serial.println (buf);
|
||||
|
||||
char result = ms.Match ("f.x");
|
||||
|
||||
if (result > 0)
|
||||
{
|
||||
Serial.print ("Found match at: ");
|
||||
Serial.println (ms.MatchStart); // 16 in this case
|
||||
Serial.print ("Match length: ");
|
||||
Serial.println (ms.MatchLength); // 3 in this case
|
||||
}
|
||||
else
|
||||
Serial.println ("No match.");
|
||||
|
||||
} // end of setup
|
||||
|
||||
void loop () {}
|
||||
Reference in New Issue
Block a user