Regex To Match The First Line Of A Text

Category: Strings

A regular expression to match the first line of a file. Can be useful in adding more content to the beginning or end of the first line of your code.



  • Anything in the first line of a text


  • Anything after the first line of a text

See Also:

Rate This Regex
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.