Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

How to lose ANSI color from String

  • 03-03-2016 9:10am
    #1
    Registered Users, Registered Users 2 Posts: 262 ✭✭


    Can be via Java or shell - Im getting outputs like

    [92mourStuff_2a947-user-zk4PaQ [][0m


Comments

  • Registered Users, Registered Users 2 Posts: 1,275 ✭✭✭bpmurray


    What's the text? If you're referring to colour codes, you're presumably missing some escape characters. Is this supposed to read "ourStuff_2a947-user-zk4PaQ"?


  • Registered Users, Registered Users 2 Posts: 1,393 ✭✭✭Inspector Gadget


    StackExchange for the win.

    Basically, they're escape codes, which means they start with the <ESC> character (ASCII 27, Octal 33, Hex 1B) and then have a regex-matchable format.

    The suggestions at the link above should help you (either just drop in the Perl script, or use the regexes offered in Java and/or shell with sed)


Advertisement