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
79 Local<String> subject);
80
86
90 Flags GetFlags() const;
91
92 V8_INLINE static RegExp* Cast(Value* value) {
93#ifdef V8_ENABLE_CHECKS
94 CheckCast(value);
95#endif
96 return static_cast<RegExp*>(value);
97 }
98
99 private:
100 static void CheckCast(Value* obj);
101};
102
103} // namespace v8
104
105#endif // INCLUDE_V8_REGEXP_H_
Definition: v8-local-handle.h:267
Definition: v8-local-handle.h:635
Definition: v8-object.h:233
Definition: v8-regexp.h:19
MaybeLocal< Object > Exec(Local< Context > context, Local< String > subject)
static RegExp * Cast(Value *value)
Definition: v8-regexp.h:92
Flags
Definition: v8-regexp.h:29
Local< String > GetSource() const
Flags GetFlags() const
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-value.h:32
Definition: libplatform.h:15
#define V8_EXPORT
Definition: v8config.h:800
#define V8_INLINE
Definition: v8config.h:500
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:671