# inlineRegexp with the new Markdown-it

**URL:** https://meta.discourse.org/t/inlineregexp-with-the-new-markdown-it/66525
**Category:** Development
**Created:** [Juillet 20, 2017, 4:04 UTC](https://meta.discourse.org/t/inlineregexp-with-the-new-markdown-it/66525 "2017-07-20T16:04:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mr8](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mr8](https://meta.discourse.org/u/mr8)
#### Post date: [Juillet 20, 2017, 4:04 UTC](https://meta.discourse.org/t/inlineregexp-with-the-new-markdown-it/66525/1 "2017-07-20T16:04:22Z")

</div>

Hello,  
Had a few plugins that utilized `inlineRegexp` and worked great until the switch to Markdown-it.

I’m completely lost with the new markdown-it… Any suggestion or example plugins that I might be able to look at?

My regex matcher was something like:

```
matcher: /^\[custom-tag1:([a-z]{2}\d{10})(?:\:([a-z0-9_-]+))?\]/i,

```

Any help or suggestions would be greatly appreciated!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Juillet 20, 2017, 4:34 UTC](https://meta.discourse.org/t/inlineregexp-with-the-new-markdown-it/66525/2 "2017-07-20T16:34:20Z")

</div>

Have a look at [https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/engines/discourse-markdown/mentions.js.es6](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/engines/discourse-markdown/mentions.js.es6) , the one issue though is that I do not yet support capture groups, I will see if I can add that.

---

<div class="post-metadata">

### Author: ![mr8](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mr8](https://meta.discourse.org/u/mr8)
#### Post date: [Juillet 20, 2017, 5:44 UTC](https://meta.discourse.org/t/inlineregexp-with-the-new-markdown-it/66525/3 "2017-07-20T17:44:24Z")

</div>

Thanks, it really helps to see a working example!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Juillet 20, 2017, 7:35 UTC](https://meta.discourse.org/t/inlineregexp-with-the-new-markdown-it/66525/4 "2017-07-20T19:35:17Z")

</div>

OK, per:

[https://github.com/discourse/discourse/commit/44fb2a2833d5ce644aeaaee32b20c034cf781915](https://github.com/discourse/discourse/commit/44fb2a2833d5ce644aeaaee32b20c034cf781915)

We now support multiple capture groups each the rule, this should make it way easier to implement your plugin.
