This may be a newbie regex question (still learning), but I'm trying to uncapitalize all the objects in my code (but not classes); i.e for the code snippet:
Bishop_Piece Bishop;
Bishop.move()...
I want it to instead be:
Bishop_Piece bishop;
bishop.move()...
What I tried:
find . -type f | xargs sed -i 's/Bishop[;.]/bishop./g'
However this results in:
Bishop_Piece bishop.
bishop.move()...
Basically, I want the character after what I'm searching for (i.e Bishop), to be 'kept' (be it ; or .), which is what explains the bishop./g.
[;.]with a capture group and return whatever you matched to the output in the same place it was found.