Regular expression to match a line that doesn't contain a word.
Regular expression to match a line that doesn't contain a word.
Student
I am Utpal Vishwas from Uttar Pradesh. Have completed my B. Tech. course from MNNIT campus Prayagraj in 2022. I have good knowledge of computer networking.
Sure, here is a regular expression to match a line that doesn't contain a word:
The
^metacharacter matches the beginning of the line, and the$metacharacter matches the end of the line. The\wmetacharacter matches any word character, which includes letters, numbers, and the underscore character. The\smetacharacter matches any whitespace character.So, this regex pattern will match any line that does not contain any word characters or whitespace characters.
For example, the following lines would be matched by this regex pattern:
The following lines would not be matched by this regex pattern: