1

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.

1 Answer 1

2
  • ^ 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 line

So it will essentially match any line and does not contain an a

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .