My favorites | Sign in
re2
Project Home Issues Source
Repository:
Checkout   Browse   Changes   Clones    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright 2008 The RE2 Authors. All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Unicode character groups.

// The codes get split into ranges of 16-bit codes
// and ranges of 32-bit codes. It would be simpler
// to use only 32-bit ranges, but these tables are large
// enough to warrant extra care.
//
// Using just 32-bit ranges gives 27 kB of data.
// Adding 16-bit ranges gives 18 kB of data.
// Adding an extra table of 16-bit singletons would reduce
// to 16.5 kB of data but make the data harder to use;
// we don't bother.

#ifndef RE2_UNICODE_GROUPS_H__
#define RE2_UNICODE_GROUPS_H__

#include "util/util.h"

namespace re2 {

struct URange16
{
uint16 lo;
uint16 hi;
};

struct URange32
{
uint32 lo;
uint32 hi;
};

struct UGroup
{
const char *name;
int sign; // +1 for [abc], -1 for [^abc]
URange16 *r16;
int nr16;
URange32 *r32;
int nr32;
};

// Named by property or script name (e.g., "Nd", "N", "Han").
// Negated groups are not included.
extern UGroup unicode_groups[];
extern int num_unicode_groups;

// Named by POSIX name (e.g., "[:alpha:]", "[:^lower:]").
// Negated groups are included.
extern UGroup posix_groups[];
extern int num_posix_groups;

// Named by Perl name (e.g., "\\d", "\\D").
// Negated groups are included.
extern UGroup perl_groups[];
extern int num_perl_groups;

} // namespace re2

#endif // RE2_UNICODE_GROUPS_H__

Change log

cb51df6be426 by Russ Cox <r...@swtch.com> on Oct 11, 2010   Diff
re2: fix (?i)[[:^lower:]] and (?i)\W

R=r
CC=re2-dev
http://codereview.appspot.com/2322045
Go to: 

Older revisions

166b9c1905c7 by Russ Cox <r...@swtch.com> on Mar 2, 2010   Diff
initial release
All revisions of this file

File info

Size: 1460 bytes, 64 lines
Powered by Google Project Hosting