skip to content
Alvin Lucillo

Match whole line completely

/ 1 min read

💻 Tech

To exactly match a line, use the hat (^) and dollar sign ($) metacharacters.

Regex: ^successful$ This only matches lines with ‘successful` text.

successful              -- matched
unsuccessful
successful_with_warning

If we only use successful regex, it will match all three lines above.