class: etk::RegExp


Description:

Regular expression interface template.
List of elment that can be displayed :

    (...)                 sub element is separate with |
    \d                    Digits                         [0-9]
    \D                    NOT a digit                    [^0-9]
    \l                    Letters                        [a-zA-Z]
    \L                    NOT a Letter                   [^a-zA-Z]
    \s                    Whitespace                     [ \t\n\r\f\v]
    \S                    NOT Whitespace                 [^ \t\n\r\f\v]
    \w                    "Word" character               [a-zA-Z0-9_]
    \W                    NOT a "Word" character         [^a-zA-Z0-9_]
    \@                    at the start or the end        not in the parsing of element ==> check if \w is not present   (other regExp will be <> ...)
    [anjdi] or [a-gt-j]   range
    .                     dot                            [^\x00-\x08\x0A-\x1F\x7F]
==> TODO :
    $                     End / Start of line of line    ==> ce sera un truc suplé comme le \@
    ^in the []            invertion of the range element
multiplicity : ==> {0, 2147483647} ? ==> {0, 1} + ==> {1, 2147483647} {x} ==> {x, x} {x,y} ==> {x, y}


Constructor and Destructor:

+                              RegExp                (const std::u32string & _exp);
+ RegExp (const std::string & _exp);
+ ~RegExp (void );

Synopsis:

+ void                         compile               (const std::string & _exp);
+ void compile (const std::u32string & _regexp);
+ std::string getRegExp (void ) const;
+ const std::u32string & getURegExp (void ) const;
+ bool getStatus (void );
+ bool parse (const CLASS_TYPE & _SearchIn,
int64_t _startPos,
int64_t _endPos,
char32_t _escapeChar);
+ bool processOneElement (const CLASS_TYPE & _SearchIn,
int64_t _startPos,
int64_t _endPos,
char32_t _escapeChar);
+ int64_t start (void );
+ int64_t stop (void );
+ void display (void );
+ void drawColoredRegEx (void );
+ std::string getRegExDecorated (void );

Detail:

RegExp

+  RegExp (const std::u32string & _exp);
+ RegExp (const std::string & _exp);
Constructor


~RegExp

+  ~RegExp (void );
Destructor


compile

+ void compile (const std::string & _exp);
+ void compile (const std::u32string & _regexp);
Set a new regular expression matching


getRegExp

+ std::string getRegExp (void ) const;
+ const std::u32string & getURegExp (void ) const;
Get the regular expression string


getStatus

+ bool getStatus (void );
Get the status if the regular expression parsing


parse

+ bool parse (const CLASS_TYPE & _SearchIn,
int64_t _startPos,
int64_t _endPos,
char32_t _escapeChar);
Parse the defined data with the compiled regular expression.


processOneElement

+ bool processOneElement (const CLASS_TYPE & _SearchIn,
int64_t _startPos,
int64_t _endPos,
char32_t _escapeChar);



start

+ int64_t start (void );
Get the expression start position detected


stop

+ int64_t stop (void );
Get the expression stop position detected


display

+ void display (void );
Display the reg Exp


drawColoredRegEx

+ void drawColoredRegEx (void );
Just display the regExp in color ...


getRegExDecorated

+ std::string getRegExDecorated (void );
Get decorated regular expression. This generate a ewol::compositing::Text decoration text. Note that can be use in ewol::widget::Label.