# \[Pitch\] Regular Expression Literals

**URL:** <https://forums.swift.org/t/pitch-regular-expression-literals/52820>\
**Category:** Pitches\
**Created:** [October 14, 2021, 3:56pm UTC](https://forums.swift.org/t/pitch-regular-expression-literals/52820 "2021-10-14T15:56:04Z")\
**Posts on this page:** 1\
**Showing post:** 64

<div class="post-metadata">

**Author:** ![YOCKOW](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/yockow/32/20636_2.png) [@YOCKOW](https://forums.swift.org/u/YOCKOW)\
**Post date:** [October 17, 2021, 11:03am UTC](https://forums.swift.org/t/pitch-regular-expression-literals/52820/64 "2021-10-17T11:03:35Z")

</div>

I understand this thread is about literals not about semantics, but I think they would be related to each other.

Let me take [my comment in the overview thread](https://forums.swift.org/t/declarative-string-processing-overview/52459/104):

> [@Declarative String Processing Overview](https://forums.swift.org/t/declarative-string-processing-overview/52459/104):
>
> We may have to discuss first whether _such feature in Swift_ should be called `Regex` or another appropriate name, and whether or not it should have _similar appearance_ with existing regular expressions in other languages. 🤓

My thoughts are

- If Swift adopts similar literals with e.g. Perl, semantics should be similar with Perl.
- If Swift adopts different semantics from e.g. Perl, literals should be different from Perl.

That would be called perceived affordance.

---

_[View the full topic](https://forums.swift.org/t/pitch-regular-expression-literals/52820)._
