Answers for "grep optional character"

0

grep optional character

# You can use append \? to a capture group to make something optional:

grep -nri "^\s*\(public\|private\|protected\)\s*\(static\)\?\s*\(sub\|function\)" formName.frm

#In this case, the preceding group, which contains the string "static", is optional (i.e. may occur 0 or 1 times).
Posted by: Guest on July-25-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language