[Solved] Regular express begin with “a” end with “b”, and can not exist a or b between

[ad_1]

You can try something like

a[^ab]*b
  • [^ab]* matches anything other than a or b zero or more times

Regex Demo

2

[ad_2]

solved Regular express begin with “a” end with “b”, and can not exist a or b between