# \#regexp

**URL:** https://discuss.ocaml.org/tag/regexp/499.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [Re2ocaml regexp compiler](https://discuss.ocaml.org/t/re2ocaml-regexp-compiler/15669)

<div class="topic-metadata">

**Author:** [@skvadrik](https://discuss.ocaml.org/u/skvadrik)\
**Replies:** 12\
**Last updated:** [February 18, 2025, 4:39pm UTC](https://discuss.ocaml.org/t/re2ocaml-regexp-compiler/15669 "2025-02-18T16:39:12Z")

</div>

Regular expression compiler re2c that was originally written in 1993 for C/C++ now supports OCaml. A short intro from the official website: re2c stands for Regular Expressions to Code. It is a free and open-source lexer…

---

## [Regexp solution for Advent for Code 2024 Day 3](https://discuss.ocaml.org/t/regexp-solution-for-advent-for-code-2024-day-3/15768)

<div class="topic-metadata">

**Author:** [@LiDazhao](https://discuss.ocaml.org/u/LiDazhao)\
**Replies:** 3\
**Last updated:** [December 8, 2024, 6:19pm UTC](https://discuss.ocaml.org/t/regexp-solution-for-advent-for-code-2024-day-3/15768 "2024-12-08T18:19:15Z")

</div>

Hi everyone, I’m having trouble implementing a regex solution for Day 3 of Advent for Code 2024. The goal is to find all the sub-strings that have the pattern mul(X,Y) with X,Y being 1 to 3 digit integers. Since I want …

---

## [Different regex rule between Python & OCaml (kinda) confuses me lol](https://discuss.ocaml.org/t/different-regex-rule-between-python-ocaml-kinda-confuses-me-lol/11827)

<div class="topic-metadata">

**Author:** [@anzhi0708](https://discuss.ocaml.org/u/anzhi0708)\
**Replies:** 3\
**Last updated:** [March 30, 2023, 3:15am UTC](https://discuss.ocaml.org/t/different-regex-rule-between-python-ocaml-kinda-confuses-me-lol/11827 "2023-03-30T03:15:03Z")

</div>

In Python, if you want to match literal parentheses, you need to escape them Python 3.11.2 (main, Feb 16 2023, 03:20:12) \[Clang 13.0.0 (clang-1300.0.29.30)\] on darwin Type "help", "copyright", "credits" or "license" for…

---

## [\[help\] Regex pattern and raw strings](https://discuss.ocaml.org/t/help-regex-pattern-and-raw-strings/11747)

<div class="topic-metadata">

**Author:** [@anzhi0708](https://discuss.ocaml.org/u/anzhi0708)\
**Replies:** 2\
**Last updated:** [March 22, 2023, 7:44pm UTC](https://discuss.ocaml.org/t/help-regex-pattern-and-raw-strings/11747 "2023-03-22T19:44:50Z")

</div>

Hello folks! Another day, another noob question. Help wanted :3 I wrote this function to remove every ‘\\n’ in the string. let remove\_newlines (str : string) : string = Str.global\_replace (Str.regexp "\\n") "" str B…

---

## [Get all regexp matches from a string](https://discuss.ocaml.org/t/get-all-regexp-matches-from-a-string/10383)

<div class="topic-metadata">

**Author:** [@olleharstedt](https://discuss.ocaml.org/u/olleharstedt)\
**Replies:** 7\
**Last updated:** [August 27, 2022, 9:23pm UTC](https://discuss.ocaml.org/t/get-all-regexp-matches-from-a-string/10383 "2022-08-27T21:23:44Z")

</div>

So the Str regexp is a nightmare :laughing: Why would Str.matched\_string throw “Invalid\_argument Str.matched\_group”??? I’m trying to write a recursive method to get all regexp matches as a list from a string. Amazingly…

---

## [Regular Expression](https://discuss.ocaml.org/t/regular-expression/9205)

<div class="topic-metadata">

**Author:** [@Nolord](https://discuss.ocaml.org/u/Nolord)\
**Replies:** 19\
**Last updated:** [January 25, 2022, 7:40pm UTC](https://discuss.ocaml.org/t/regular-expression/9205 "2022-01-25T19:40:28Z")

</div>

Hello, So I wanted to be able to convert a string input into a string list, with a separation matching a certain pattern. I found out about the Srt module and its regexp functionnality wich seemed to be the thing I was …
