# Hide markdown cell based on regex

**URL:** <https://discourse.jupyter.org/t/hide-markdown-cell-based-on-regex/23816>\
**Category:** nbconvert\
**Created:** [February 6, 2024, 2:54pm UTC](https://discourse.jupyter.org/t/hide-markdown-cell-based-on-regex/23816 "2024-02-06T14:54:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpn](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jpn/32/12334_2.png) [@jpn](https://discourse.jupyter.org/u/jpn)\
**Post date:** [February 6, 2024, 2:54pm UTC](https://discourse.jupyter.org/t/hide-markdown-cell-based-on-regex/23816/1 "2024-02-06T14:54:36Z")

</div>

I am trying to hide a markdown cell using a pattern like stated on docs

[https://nbconvert.readthedocs.io/en/latest/removing\_cells.html?highlight=RegexRemovePreprocessor.patterns#removing-cells-using-regular-expressions-on-cell-content](https://nbconvert.readthedocs.io/en/latest/removing_cells.html?highlight=RegexRemovePreprocessor.patterns#removing-cells-using-regular-expressions-on-cell-content)

But It seems to me that trick only works for code cells. Is that so?

---

<div class="post-metadata">

**Author:** ![spookster](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/spookster/32/8939_2.png) [@spookster](https://discourse.jupyter.org/u/spookster)\
**Post date:** [February 11, 2024, 10:41am UTC](https://discourse.jupyter.org/t/hide-markdown-cell-based-on-regex/23816/2 "2024-02-11T10:41:15Z")

</div>

instead of using regex use jupyters tag system!

open the property inspector on the right bar and under common tools add a tag (i.e. ‘hidden’) to the cells you do not want to include.  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/1/18268195221b8068ef798cf7ce10b45be92ae1a7.png)

you can then use `jupyter nbconvert --to html --TagRemovePreprocessor.remove_cell_tags="hidden" mynotebook.ipynb`

this works with all kinds of cells.

edit: if you still want to use regex, post some code snippets of what you want achieve, that would be helpful, to help you 🙂

---

<div class="post-metadata">

**Author:** ![jpn](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jpn/32/12334_2.png) [@jpn](https://discourse.jupyter.org/u/jpn)\
**Post date:** [February 12, 2024, 10:24am UTC](https://discourse.jupyter.org/t/hide-markdown-cell-based-on-regex/23816/3 "2024-02-12T10:24:32Z")

</div>

Tags are great! But neither google Colab enterprise or community seam to implement them, correct-me if I’m wrong, also sorry for asking in the forum, I should have asked them “colab” instead O:)
