#include "qregexp.h"
#include <ctype.h>
#include <stdlib.h>
Go to the source code of this file.
|
#define | GEN(x) *d++ = (x) |
|
#define GEN |
( |
|
x | ) |
*d++ = (x) |
static uint char_val |
( |
const char ** |
str, |
|
|
uint * |
strlength |
|
) |
| |
|
static |
Definition at line 749 of file qregexp.cpp.
751 const char *
p = *
str;
752 uint pl = *strlength;
755 if ( (
char)*p ==
'\\' ) {
766 char ch = tolower((
char)*p);
768 case 'b': v =
'\b';
break;
769 case 'f': v =
'\f';
break;
770 case 'n': v =
'\n';
break;
771 case 'r': v =
'\r';
break;
772 case 't': v =
'\t';
break;
773 case 's': v =
PWS;
break;
774 case 'd': v =
PDG;
break;
775 case '<': v =
BOW;
break;
776 case '>': v =
EOW;
break;
781 for ( i = 0; (i < 4) && pl; i++ ) {
782 c = tolower((
char)*p);
783 bool a = ( c >=
'a' && c <=
'f' );
784 if ( (c >=
'0' && c <=
'9') ||
a ) {
786 v += a ? 10 + c -
'a' : c -
'0';
799 if ( ch >=
'0' && ch <=
'7' ) {
801 for ( i = 0; (i < 3) && pl; i++ ) {
803 if ( c >=
'0' && c <=
'7' ) {
static bool iswordchar |
( |
int |
x | ) |
|
|
inlinestatic |
static bool matchcharclass |
( |
uint * |
rxd, |
|
|
char |
c |
|
) |
| |
|
static |
Definition at line 367 of file qregexp.cpp.
371 bool neg = clcode ==
CCN;
372 if ( clcode !=
CCL && clcode !=
CCN)
373 qWarning(
"QRegExp: Internal error, please report to qt-bugs@trolltech.com");
375 uint cval = (
unsigned char)
c;
377 for (
int i = 0; i < (
int)numFields; i++ ) {
379 if ( *d ==
PWS && isspace(
c) ) {
383 if ( *d ==
PDG && isdigit(
c) ) {
388 uint from = ( *d &
MCD ) >> 16;
390 if ( (cval >= from) && (cval <= to) ) {
396 return neg ? !found :
found;
void qWarning(const char *msg,...)
static int matchstring |
( |
uint * |
rxd, |
|
|
const char * |
str, |
|
|
uint |
strlength, |
|
|
const char * |
bol, |
|
|
bool |
cs |
|
) |
| |
|
static |
p->row() &&
Definition at line 405 of file qregexp.cpp.
409 const char *start =
p;
420 if ( tolower(*p) != c )
432 else if ( *d &
MCC ) {
441 else switch ( *d++ ) {
443 if ( !pl || !isspace(*p) )
449 if ( !pl || !isdigit(*p) )
478 const char *first_p =
p;
482 while ( pl && tolower(*p)==
c ) {
488 while ( pl && *p == c ) {
495 else if ( *d & MCC ) {
502 else if ( *d ==
PWS ) {
503 while ( pl && isspace(*p) ) {
509 else if ( *d ==
PDG ) {
510 while ( pl && isdigit(*p) ) {
516 else if ( *d ==
ANY ) {
525 while ( p >= first_p ) {
528 return ( (
int)(p - start) ) +
end;
538 const char *first_p =
p;
542 if ( pl && tolower(*p) == c ) {
548 if ( pl && *p == c ) {
555 else if ( *d & MCC ) {
562 else if ( *d ==
PWS ) {
563 if ( pl && isspace(*p) ) {
569 else if ( *d ==
PDG ) {
570 if ( pl && isdigit(*p) ) {
576 else if ( *d ==
ANY ) {
587 while ( p >= first_p ) {
590 return ( (
int)(p - start) ) +
end;
603 return (
int)(p - start);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
static int matchstring(uint *rxd, const char *str, uint strlength, const char *bol, bool cs)
static bool matchcharclass(uint *rxd, char c)
static bool iswordchar(int x)
Definition at line 707 of file qregexp.cpp.
713 for(
int i = 0; i < patlen; i++ ) {
730 if ( (
char)pattern[i+1] ==
'^' ) {
const uint ANY = 0x80050000 |
const uint BOL = 0x80010000 |
const uint BOW = 0x80030000 |
const uint CCL = 0x20010000 |
const uint CCN = 0x20020000 |
const uint CHR = 0x40000000 |
const uint CLO = 0x80070000 |
const uint END = 0x00000000 |
const uint EOL = 0x80020000 |
const uint EOW = 0x80040000 |
const uint MCC = 0x20000000 |
const uint MCD = 0xffff0000 |
const uint MVL = 0x0000ffff |
const uint OPT = 0x80080000 |
const int PatOverflow = 4 |
const uint PDG = 0x10020000 |
const uint PWS = 0x10010000 |