I used to do this. I had absolutely no awareness that I was doing it until I could feel pain or blood and it caused a lot of shame and embarrassment for me. I suspect I replaced it with smoking back in the day when that was a good idea.
It's a tough one and I am sorry. I imagine that picking up new nervous habits would help just as smoking helped mine. I am by no means saying give smoking but maybe try to get hooked on finger drumming or fidgeting with rings or a watch?? Just when you feel anxiety coming on try the new behavior or switch over when you catch yourself.
Ultimately, I am sure that anxiety is the root cause, so obviously finding a way to lower your stress level ought to help but back here in the real world where that usually takes some time, I really think trying to swap it out for something else might help. I've been a fingernail chewer, one of those people who pulls out face and body hair, a smoker, a pencil chewer, a picker, etc. Now I chew on small sticks of wood such as toothpicks and mint flavored dental picks and chronically twist my rings around my fingers. I had to make a conscious effort to change a lot of behaviors but the need for some anxious habit remains.
Best of luck to you. It's hard to change behaviors we don't even realize we are engaging in.