Loading...
Searching...
No Matches
v8-regexp.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_V8_REGEXP_H_
6#define INCLUDE_V8_REGEXP_H_
7
8#include "v8-local-handle.h" // NOLINT(build/include_directory)
9#include "v8-object.h" // NOLINT(build/include_directory)
10#include "v8config.h" // NOLINT(build/include_directory)
11
12namespace v8 {
13
14class Context;
15
19class V8_EXPORT RegExp : public Object {
20 public:
29 enum Flags {
30 kNone = 0,
31 kGlobal = 1 << 0,
32 kIgnoreCase = 1 << 1,
33 kMultiline = 1 << 2,
34 kSticky = 1 << 3,
35 kUnicode = 1 << 4,
36 kDotAll = 1 << 5,
37 kLinear = 1 << 6,
38 kHasIndices = 1 << 7,
39 kUnicodeSets = 1 << 8,
40 };
41
42 static constexpr int kFlagCount = 9;
43
55 Local<String> pattern,
56 Flags flags);
57
64 Local<Context> context, Local<String> pattern, Flags flags,
65 uint32_t backtrack_limit);
66
78 V8_DEPRECATE_SOON("Use ExecV2 instead")
80 Local<String> subject);
82 Local<String> subject);
83
88 Local<String> GetSource() const;
89
93 Flags GetFlags() const;
94
95 V8_INLINE static RegExp* Cast(Value* value) {
96#ifdef V8_ENABLE_CHECKS
97 CheckCast(value);
98#endif
99 return static_cast<RegExp*>(value);
100 }
101
102 private:
103 static void CheckCast(Value* obj);
104};
105
106} // namespace v8
107
108#endif // INCLUDE_V8_REGEXP_H_
Definition: v8-context.h:55
Definition: v8-local-handle.h:359
Definition: v8-local-handle.h:730
Definition: v8-object.h:267
Definition: v8-regexp.h:19
Flags
Definition: v8-regexp.h:29
static MaybeLocal< RegExp > New(Local< Context > context, Local< String > pattern, Flags flags)
static MaybeLocal< RegExp > NewWithBacktrackLimit(Local< Context > context, Local< String > pattern, Flags flags, uint32_t backtrack_limit)
Definition: v8-primitive.h:126
Definition: v8-value.h:32
Definition: libplatform.h:15
#define V8_EXPORT
Definition: v8config.h:874
#define V8_INLINE
Definition: v8config.h:518
#define V8_DEPRECATE_SOON(message)
Definition: v8config.h:631
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:688