From 8f8b41c565c70ab99dd21a81f71a512958f867b5 Mon Sep 17 00:00:00 2001 From: ph10 Date: Tue, 18 May 2010 15:47:01 +0000 Subject: Added PCRE_UCP and related stuff to make \w etc use Unicode properties. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@518 2f5784b3-3f2a-0410-8824-cb99058d5e15 --- pcretest.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'pcretest.c') diff --git a/pcretest.c b/pcretest.c index a640c66..671a606 100644 --- a/pcretest.c +++ b/pcretest.c @@ -741,9 +741,8 @@ return 0; * Check newline indicator * *************************************************/ -/* This is used both at compile and run-time to check for escapes, where -xxx is LF, CR, CRLF, ANYCRLF, or ANY. Print a message and return 0 if there is -no match. +/* This is used both at compile and run-time to check for escapes. Print +a message and return 0 if there is no match. Arguments: p points after the leading '<' @@ -1238,6 +1237,7 @@ while (!done) case 'S': do_study = 1; break; case 'U': options |= PCRE_UNGREEDY; break; + case 'W': options |= PCRE_UCP; break; case 'X': options |= PCRE_EXTRA; break; case 'Z': debug_lengths = 0; break; case '8': options |= PCRE_UTF8; use_utf8 = 1; break; @@ -1268,7 +1268,7 @@ while (!done) case '<': { - if (strncmp((char *)pp, "JS>", 3) == 0) + if (strncmpic(pp, (uschar *)"JS>", 3) == 0) { options |= PCRE_JAVASCRIPT_COMPAT; pp += 3; @@ -1309,6 +1309,7 @@ while (!done) if ((options & PCRE_DOTALL) != 0) cflags |= REG_DOTALL; if ((options & PCRE_NO_AUTO_CAPTURE) != 0) cflags |= REG_NOSUB; if ((options & PCRE_UTF8) != 0) cflags |= REG_UTF8; + if ((options & PCRE_UCP) != 0) cflags |= REG_UCP; if ((options & PCRE_UNGREEDY) != 0) cflags |= REG_UNGREEDY; rc = regcomp(&preg, (char *)p, cflags); @@ -1555,7 +1556,7 @@ while (!done) if (do_flip) all_options = byteflip(all_options, sizeof(all_options)); if (get_options == 0) fprintf(outfile, "No options\n"); - else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", + else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", ((get_options & PCRE_ANCHORED) != 0)? " anchored" : "", ((get_options & PCRE_CASELESS) != 0)? " caseless" : "", ((get_options & PCRE_EXTENDED) != 0)? " extended" : "", @@ -1569,6 +1570,7 @@ while (!done) ((get_options & PCRE_UNGREEDY) != 0)? " ungreedy" : "", ((get_options & PCRE_NO_AUTO_CAPTURE) != 0)? " no_auto_capture" : "", ((get_options & PCRE_UTF8) != 0)? " utf8" : "", + ((get_options & PCRE_UCP) != 0)? " ucp" : "", ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf8_check" : "", ((get_options & PCRE_DUPNAMES) != 0)? " dupnames" : ""); -- cgit v1.2.1