-
-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Tested in PowerShell 7.5.4 using Windows Terminal.
If any of the following characters appear in any colored section ('<c="red">here</c>') the coloring will not work for that section. It appears not to affect other sections of the same string.
\ ? * + [ $ ^ ( )
I tried escaping them with backslashes. Did not work.
I tried escaping them with backticks. Did not work.
I tried HTML codes such as ? for a question mark. Did not block the coloring but did not convert to ? either.
I tried doubling them up. This works for single-quotes only within a single-quoted string, as far as I can tell. It does not work for any of the characters I listed.
Sometimes, an error message will pop up:
It makes sense that those characters would cause issues. It looks from the error messages to be related to regular expressions in some way.
Note: I was going to paste a different screenshot of the other cases I mentioned but for some reason it doesn't show. It just duplicates the first screenshot. Anyway, the same thing happens whether you do '<c="red">...</c>' or "<c='red'>...</c>".