You need to provide more details on what you are trying to accomplish. I think you are asking about using the command line to modify some sort of text....is it file names, or the contents of a file, or something else?
There are multiple ways to modify text on the command line with some being better than others depending on the exact specific circumstances and on macOS with many very outdated & very limited options/behavior of the command line utilities it can be very tricky to get some of those options to work especially if you try looking for examples online where most will be for much newer & expanded Linux utilities.
AFAIK, there is no way to differentiate parts of a command within the Terminal, but if you are writing a script, then some text editors (BBEdit) may be aware of various shell syntax where it may highlight some portions of the command although I don't think it will highlight/differentiate the part you are concerned about. I know sometimes you can have the command line appear with various colors when typing a command or viewing the output (Linux for sure), but that needs to be configured through a shell profile. I have no idea what, if any such options are available with any of the macOS shells.
When I am experimenting & testing commands & options, I will make sure I limit myself to a test folder & test data....usually also making a copy of the data I want to actually use before I implement it on that actual real data. You may discover that your command & options may not be correct for all possible text combinations when searching & replacing text.
Make sure you have a good backup before doing any experimenting with the command line since the command line has no safety nets. It is very easy to accidentally destroy all your data with one incorrect character. In fact, you may even want to experiment within another macOS user account or on another boot drive/computer before trying the final command on your main system.