v8 10.2.154 (node 18.16.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
v8-regexp.h
Go to the documentation of this file.
1
2// Copyright 2021 the V8 project authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5
6#ifndef INCLUDE_V8_REGEXP_H_
7#define INCLUDE_V8_REGEXP_H_
8
9#include "v8-local-handle.h" // NOLINT(build/include_directory)
10#include "v8-object.h" // NOLINT(build/include_directory)
11#include "v8config.h" // NOLINT(build/include_directory)
12
13namespace v8 {
14
15class Context;
16
20class V8_EXPORT RegExp : public Object {
21 public:
30 enum Flags {
31 kNone = 0,
32 kGlobal = 1 << 0,
33 kIgnoreCase = 1 << 1,
34 kMultiline = 1 << 2,
35 kSticky = 1 << 3,
36 kUnicode = 1 << 4,
37 kDotAll = 1 << 5,
38 kLinear = 1 << 6,
39 kHasIndices = 1 << 7,
40 };
41
42 static constexpr int kFlagCount = 8;
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_
V8_WARN_UNUSED_RESULT MaybeLocal< Object > Exec(Local< Context > context, Local< String > subject)
static V8_INLINE RegExp * Cast(Value *value)
Definition v8-regexp.h:92
Local< String > GetSource() const
static V8_WARN_UNUSED_RESULT MaybeLocal< RegExp > NewWithBacktrackLimit(Local< Context > context, Local< String > pattern, Flags flags, uint32_t backtrack_limit)
Flags GetFlags() const
static V8_WARN_UNUSED_RESULT MaybeLocal< RegExp > New(Local< Context > context, Local< String > pattern, Flags flags)
#define V8_EXPORT
Definition v8config.h:578
#define V8_INLINE
Definition v8config.h:425
#define V8_WARN_UNUSED_RESULT
Definition v8config.h:499