# regex select entire line starting with..

> Learn how to use a regex like ^booktitle:.* in VS Code to select an entire line starting with a given prefix, then delete it by replacing with nothing.

Author: Flavio Copes | Published: 2024-02-17 | Canonical: https://flaviocopes.com/regex-select-entire-line-starting-with/

Had a bunch of markdown files with a frontmatter property I didn’t need any more, so I used this search expression in VS Code with regex enabled to find all lines starting with `booktitle:` and removed the entire line using replace with an empty string (tip: you can try patterns like this against sample text in my [regex tester](https://flaviocopes.com/tools/regex-tester/)):

```javascript

^booktitle:.*
```

![VS Code search and replace panel with regex pattern ^booktitle:.* in the search field](https://flaviocopes.com/images/regex-select-entire-line-starting-with/1.webp)
