I need to replace each character of a regular expression, once evaluated, with each character plus the @ symbol.
For example:
If the regular expression is: POS[AB]
and the input text is: POSA_____POSB
I want to get this result: P@O@S@A@_____P@O@S@B@
Please, using sed or awk.
I have tried this:
$ echo "POSA_____POSB" | sed "s/POS[AB]/&@/g"
POSA@_____POSB@
$ echo "POSA_____POSB" | sed "s/./&@/g"
P@O@S@A@_@_@_@_@_@P@O@S@B@
But what I need is:
P@O@S@A@_____P@O@S@B@
Thank you in advance.
Best regards, Octavio
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)