Return cells whose code contains *substring*. Performs a case-sensitive substring search on each cell's code. Example:: ctx.cells.find("import marimo")
(self, substring: str)
| 599 | # ------------------------------------------------------------------ |
| 600 | |
| 601 | def find(self, substring: str) -> Sequence[NotebookCell]: |
| 602 | """Return cells whose code contains *substring*. |
| 603 | |
| 604 | Performs a case-sensitive substring search on each cell's code. |
| 605 | |
| 606 | Example:: |
| 607 | |
| 608 | ctx.cells.find("import marimo") |
| 609 | """ |
| 610 | return [ |
| 611 | self._cell_view(c) for c in self._doc.cells if substring in c.code |
| 612 | ] |
| 613 | |
| 614 | def grep(self, pattern: str) -> Sequence[NotebookCell]: |
| 615 | """Return cells whose code matches the regex *pattern*. |