Fix guide anchor generation logic.

This could use in any translation because it's not limited to `[^a-z0-9]`.

Verify after this change, all guides still have same anchors.

[Robin Dupret & Juanito Fatas]
Merge pull request #16667 from JuanitoFatas/patch/anchor-generation

Fix guide anchor generation logic.