Community
    • Login

    Can I replace character with linefeedchracater in Notepad++ ?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 3 Posters 415 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Stephen KnappS
      Stephen Knapp
      last edited by

      Using the replace feature in Notepad++, is there a way to replace a character such as: “[” the left bracket say with a combination to effect a “Line-Feed” and then the “[” bracket?

      • thanks in advance
      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Stephen Knapp
        last edited by

        @Stephen-Knapp

        Yes, you would use Regular expression for the Search mode, and specify a Find what box of \[ and then in the Replace with box you would put \n[

        Alan KilbornA 1 Reply Last reply Reply Quote 1
        • Alan KilbornA
          Alan Kilborn @Alan Kilborn
          last edited by

          Hmmm, upvotes of a bad regex…hmmm… :-)

          I swear I was thinking \[ for Find what as I was composing before.

          [ by itself generates Find: Invalid regular expression in red at the bottom of the Find window.

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Alan Kilborn
            last edited by Alan Kilborn

            WTF

            Did I do it again, or did this site consume my backslash?

            I meant \\[
            and so far now I’ve meant it twice!

            Edit: Apparently the site ate it, and I did it right the earlier times, I just didn’t proof it.

            Normally if you put a single backslash inside backticks, this site will keep it.
            But if it is the first character after the opening backtick, it will eat it???

            PeterJonesP 1 Reply Last reply Reply Quote 1
            • PeterJonesP
              PeterJones @Alan Kilborn
              last edited by PeterJones

              @Alan-Kilborn
              \[ vs \\[

              `\[` vs `\\[`
              

              Both look right in preview
              …
              Edit: but final render doesn’t match preview

              PeterJonesP 1 Reply Last reply Reply Quote 1
              • PeterJonesP
                PeterJones @PeterJones
                last edited by

                Now that I’m on a computer, rather than my phone, a fuller experiment:

                `!` `\!`
                `"` `\"`
                `#` `\#`
                `$` `\$`
                `%` `\%`
                `&` `\&`
                `'` `\'`
                `(` `\(`
                `)` `\)`
                `*` `\*`
                `+` `\+`
                `,` `\,`
                `-` `\-`
                `.` `\.`
                `/` `\/`
                `0` `\0`
                `1` `\1`
                `2` `\2`
                `3` `\3`
                `4` `\4`
                `5` `\5`
                `6` `\6`
                `7` `\7`
                `8` `\8`
                `9` `\9`
                `:` `\:`
                `;` `\;`
                `<` `\<`
                `=` `\=`
                `>` `\>`
                `?` `\?`
                `@` `\@`
                `A` `\A`
                `B` `\B`
                `C` `\C`
                `D` `\D`
                `E` `\E`
                `F` `\F`
                `G` `\G`
                `H` `\H`
                `I` `\I`
                `J` `\J`
                `K` `\K`
                `L` `\L`
                `M` `\M`
                `N` `\N`
                `O` `\O`
                `P` `\P`
                `Q` `\Q`
                `R` `\R`
                `S` `\S`
                `T` `\T`
                `U` `\U`
                `V` `\V`
                `W` `\W`
                `X` `\X`
                `Y` `\Y`
                `Z` `\Z`
                `[` `\[`
                `]` `\]`
                `^` `\^`
                `_` `\_`
                `a` `\a`
                `b` `\b`
                `c` `\c`
                `d` `\d`
                `e` `\e`
                `f` `\f`
                `g` `\g`
                `h` `\h`
                `i` `\i`
                `j` `\j`
                `k` `\k`
                `l` `\l`
                `m` `\m`
                `n` `\n`
                `o` `\o`
                `p` `\p`
                `q` `\q`
                `r` `\r`
                `s` `\s`
                `t` `\t`
                `u` `\u`
                `v` `\v`
                `w` `\w`
                `x` `\x`
                `y` `\y`
                `z` `\z`
                `{` `\{`
                `|` `\|`
                `}` `\}`
                `~` `\~`
                

                ! \!
                " \"
                # \#
                $ \$
                % \%
                & \&
                ' \'
                ( \(
                ) \)
                * \*
                + \+
                , \,
                - \-
                . \.
                / \/
                0 \0
                1 \1
                2 \2
                3 \3
                4 \4
                5 \5
                6 \6
                7 \7
                8 \8
                9 \9
                : \:
                ; \;
                < \<
                = \=
                > \>
                ? \?
                @ \@
                A \A
                B \B
                C \C
                D \D
                E \E
                F \F
                G \G
                H \H
                I \I
                J \J
                K \K
                L \L
                M \M
                N \N
                O \O
                P \P
                Q \Q
                R \R
                S \S
                T \T
                U \U
                V \V
                W \W
                X \X
                Y \Y
                Z \Z
                [ \[
                ] \]
                ^ \^
                _ \_
                a \a
                b \b
                c \c
                d \d
                e \e
                f \f
                g \g
                h \h
                i \i
                j \j
                k \k
                l \l
                m \m
                n \n
                o \o
                p \p
                q \q
                r \r
                s \s
                t \t
                u \u
                v \v
                w \w
                x \x
                y \y
                z \z
                { \{
                | \|
                } \}
                ~ \~

                I skipped the backslash-backslash pair, and the backslash backtick pair, because those both add another layer of confusion. The preview shows all of thse as I would expect:

                b17c5587-5e3a-4f44-af06-1347cd293649-image.png .

                Let’s see how it renders after posting…

                PeterJonesP 1 Reply Last reply Reply Quote 1
                • PeterJonesP
                  PeterJones @PeterJones
                  last edited by

                  @PeterJones said in Can I replace character with linefeedchracater in Notepad++ ?:

                  Let’s see how it renders after posting…

                  baa88330-f1b9-45cf-9976-70e53c601375-image.png

                  Looks like \\[ and \\] have special meaning in the forum’s markdown’s backtick implementation. Weird.

                  1 Reply Last reply Reply Quote 3
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors