help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pattern matching lines starting with double comment characters


From: goncholden
Subject: Pattern matching lines starting with double comment characters
Date: Sat, 25 Feb 2023 11:25:53 +0000

I want to match lines that start with double comment characters in source code 
files.

I am currently using

pn_ere = "^[[:space:]]*([#;!]+|@c|//)[[:space:]]+"​

The pattern handles possible spaces at the beginning and end of lines.

But the pattern does not specify double comment characters

Case of ##
Case of ;;
Case of !!

How can adapt the pattern for these cases?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]