How can I match a pattern as long as it’s not at the beginning with regex?

You can use a look behind to make sure it is not at the beginning. (?<!^)aaa

Leave a Comment