312 if ( wildcard !=
wc ) {
337 if (
cs != enable ) {
358 return isalnum(x) || x ==
'_';
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;
406 const char *bol,
bool cs )
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);
619 const QChar *bol )
const 650 bool indexIsStart )
const 656 const char *start = str.
data();
657 const char *
p = start +
index;
668 while ( pl && ( tolower(*p) != c ) ) {
673 while ( pl && *p != c ) {
680 ep =
matchstring( d, p, pl, indexIsStart ? start+index : start,
cs );
690 *len = ep >= 0 ? ep : 0;
691 return ep >= 0 ? (
int)(p - start) : -1;
713 for(
int i = 0; i < patlen; i++ ) {
730 if ( (
char)pattern[i+1] ==
'^' ) {
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' ) {
829 #if 0 //defined(DEBUG) 832 while ( *p !=
END ) {
837 qDebug(
"\tCHR\tU%04x (%c)", u, (c ? c :
' '));
840 else if ( *p &
MCC ) {
844 qDebug(
"\tCCL\t%i", numFields );
845 else if ( clcode ==
CCN )
846 qDebug(
"\tCCN\t%i", numFields );
849 for (
int i = 0; i < (
int)numFields; i++ ) {
853 else if ( *p ==
PDG )
856 uint from = ( *p &
MCD ) >> 16;
858 char fc = (char)from;
860 qDebug(
"\t\tU%04x (%c) - U%04x (%c)", from,
861 (fc ? fc :
' '), to, (tc ? tc :
' ') );
866 else switch ( *p++ ) {
932 const char *start = pattern.
data();
933 const char *
p = start;
938 #define GEN(x) *d++ = (x) 974 bool firstIsEscaped = ( (char)*p ==
'\\' );
976 if ( cch ==
'^' && !firstIsEscaped ) {
988 if ((pl>2) && ((
char)*p ==
'-') && ((
char)*(p+1) !=
']')) {
997 GEN( (cch << 16) | cch2 );
1005 GEN( (cch << 16) | cch );
1016 bool nextIsEscaped = ( (char)*p ==
'\\' );
1018 if ( cch == (
uint)
']' && !nextIsEscaped )
1025 *prev_d |= numFields;
1033 if ( prev_d == 0 ) {
1037 switch ( *prev_d ) {
1046 int ddiff = (
int)(d - prev_d);
1052 memcpy( d, prev_d, ddiff*
sizeof(
uint) );
1056 memmove( prev_d+1, prev_d, ddiff*
sizeof(
uint) );
1057 *prev_d = ch ==
'?' ?
OPT :
CLO;
1073 if ( !
cs && cv <= 0xff )
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
void qDebug(const char *msg,...)
static int matchstring(uint *rxd, const char *str, uint strlength, const char *bol, bool cs)
static uint char_val(const char **str, uint *strlength)
The QRegExp class provides pattern matching using regular expressions or wildcards.
void qWarning(const char *msg,...)
The QChar class provides a light-weight Unicode character.
static bool matchcharclass(uint *rxd, char c)
bool operator==(const QRegExp &) const
QRegExp & operator=(const QRegExp &)
const char * matchstr(uint *, const char *, uint, const char *) const
static bool iswordchar(int x)
def dump(input_file, output_file)
void setCaseSensitive(bool)
const char * data() const
int match(const QCString &str, int index=0, int *len=0, bool indexIsStart=TRUE) const
static QCString wc2rx(const QCString &pattern)
static uint rxarray[maxlen]
bool caseSensitive() const