DEV Community

Pulkit
Pulkit

Posted on

Quick regex to find a word and delete the whole line

Use the replace command in your IDE, Android studio and run this regex
^.\b(WORD_HERE)\b.$\r?\n
Replace WORD_HERE with the word you are trying to find and keep the replacing text as blank.

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Ask anything about your entire project, code and get answers and even architecture diagrams. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Start free in your IDE

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay