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.
/^(.*)$/m
Matches:
- Anything in the first line of a text
Non-matches:
- Anything after the first line of a text
See Also:
Rate This Regex
User Review
( votes)Expression Flags
Flags | Description |
---|---|
i |
Ignore case sensitive. |
g |
Allows global search. |
m |
Allows multiline search. |