# 감시 단어 정규식에서 negative lookbehind가 작동하지 않음

**URL:** <https://meta.discourse.org/t/negative-lookbehind-not-working-in-watched-words-regex/271981>\
**Category:** Product Support\
**Tags:** watched-words\
**Created:** [7월 18, 2023, 12:56오후 UTC](https://meta.discourse.org/t/negative-lookbehind-not-working-in-watched-words-regex/271981 "2023-07-18T12:56:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tkrunning](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tkrunning/32/119481_2.png) [@tkrunning](https://meta.discourse.org/u/tkrunning)\
**Post date:** [7월 18, 2023, 12:56오후 UTC](https://meta.discourse.org/t/negative-lookbehind-not-working-in-watched-words-regex/271981/1 "2023-07-18T12:56:07Z")

</div>

부정 후방 탐색(negative lookbehind) 표현은 Ruby와 JS의 정규식에서 모두 유효해야 합니다(후자는 ECMAScript 2018부터). 하지만 Watched Words에서는 작동하지 않는 것 같습니다.

예를 들어:

` (?<!new\s)\bcar\b` 는 ` new` 앞에 오지 않는 `car` 인스턴스에 매칭되어야 합니다.

즉, 이 문장에서는 `car`에 매칭되어야 합니다:

`He drives a car`

하지만 이 문장에서는 매칭되면 안 됩니다:

`He drives a new car`

그러나 Watched Words에 추가하면 다음과 같은 오류가 발생합니다:

![Regex error](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/4X/0/7/f/07f6b4b4d556558a159f42ac22084d3c888489fc.png)

이는 의도적으로 지원하지 않는 기능인가요, 아니면 버그인가요? 아니면 다른 방식으로 작성해야 하나요?

---

_[View the full topic](https://meta.discourse.org/t/negative-lookbehind-not-working-in-watched-words-regex/271981)._
