How to unescape?



  • Hello!
    How (in NPP) to unescape all escapes (\"\r\n\t…) in the whole text (by one command)? Is it possible at all (without creating some macro by myself)?
    Thanks!



  • @Valerjans-Vinogradovs

    if it is text -> find/replace, if it isn’t text than be more specific about what you want.

    Cheers
    Claudia



  • @Claudia-Frank, How in find/replace to unescape all escapes (for example: \" … \r\n … \t …) in the whole text by one command (by one click on the button “Replace All”)?



  • @Valerjans-Vinogradovs

    first post ("\r\n\t…)
    next post (for example: " … \r\n … \t …)

    I assume the real text is even different, so how should we know what your text really looks like to give you an advice?? Because of that lack of information I only can give
    you an general answer.

    If there is a pattern you might be able to use Extended search mode, if the pattern
    is different try to find a regular expression which fits all.

    Cheers
    Claudia



  • Is the OP asking how to replace two character sequences (for example, “” followed by “r”) in his editor window with their corresponding single character value (13 or hex 0D in the example)? Just a guess as I can’t really tell.

    This speaks to a general complaint about a lot of posters on this community: Not enough information is given to BEST solve a problem. People will post, “How can I do XXX?” when a much better question is “I think I need to do XXX because I need to achieve <insert detailed explanation here> – how can I best do this?”. The experts here, who could certainly answer the XXX question, might answer it in a totally different way with the benefit of background info that gives the poster a much better push towards solving their real problem in a efficient, clean and often elegant way! :)



  • Is the OP asking how to replace two character sequences (for example, “” followed by “r”) in his editor window with their corresponding single character value (13 or hex 0D in the example)? Just a guess as I can’t really tell.

    Didn’t thought about this - thought OP maybe has some code with literals \t …
    and the compiler complaint about it but …

    Cheers
    Claudia



  • "\r\n\t …

    as well as

    \" … \r\n … \t …

    can be unescaped by find/replace by one click on the button “Replace All” when:

    in the first field (Find what) is entered: (\\r\\n)|(\t)|(\\\")

    and in second field (Replace with) is entered: (?1(\r\n))(?2(\t))(?3(\"))



  • a little correction to previous post: there must be \\t instead of \t in the first field


Log in to reply