I want to match all strings that have only one single character (including having with + or -) to turn into X but I get this output instead whenever I run it:
Xone X
Xtwo X
Xthree X
Here's the file that I'm supposed to run with:
Cone A-
Ctwo D
Cthree C+
Here's the code I've been working on:
code.sed
#!/bin/sed
s/[A-D][+-]/X/
s/[A-D]/X/
Desired output:
Cone X
Ctwo X
Cthree X