I'm not sure about the meaning of this regular expression.
^[^a]*$
Does that mean, we don't want any string started with the letter a or contain a. And we don't want any string ended with also the letter a ?.
thanks.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI'm not sure about the meaning of this regular expression.
^[^a]*$
Does that mean, we don't want any string started with the letter a or contain a. And we don't want any string ended with also the letter a ?.
thanks.
^
asserts position at start of a line[^a]
Match a single character not present in the list*
Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)$
asserts position at the end of a lineSo it will essentially match any line and does not contain an a