• Login
Community
  • Login

Can I replace character with linefeedchracater in Notepad++ ?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 3 Posters 420 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.
  • S
    Stephen Knapp
    last edited by Jul 5, 2020, 4:58 PM

    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
    A 1 Reply Last reply Jul 5, 2020, 5:23 PM Reply Quote 0
    • A
      Alan Kilborn @Stephen Knapp
      last edited by Jul 5, 2020, 5:23 PM

      @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[

      A 1 Reply Last reply Jul 5, 2020, 7:25 PM Reply Quote 1
      • A
        Alan Kilborn @Alan Kilborn
        last edited by Jul 5, 2020, 7:25 PM

        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.

        A 1 Reply Last reply Jul 5, 2020, 10:22 PM Reply Quote 1
        • A
          Alan Kilborn @Alan Kilborn
          last edited by Alan Kilborn Jul 5, 2020, 10:24 PM Jul 5, 2020, 10:22 PM

          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???

          P 1 Reply Last reply Jul 5, 2020, 10:58 PM Reply Quote 1
          • P
            PeterJones @Alan Kilborn
            last edited by PeterJones Jul 5, 2020, 10:59 PM Jul 5, 2020, 10:58 PM

            @Alan-Kilborn
            \[ vs \\[

            `\[` vs `\\[`
            

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

            P 1 Reply Last reply Jul 6, 2020, 1:03 PM Reply Quote 1
            • P
              PeterJones @PeterJones
              last edited by Jul 6, 2020, 1:03 PM

              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…

              P 1 Reply Last reply Jul 6, 2020, 1:04 PM Reply Quote 1
              • P
                PeterJones @PeterJones
                last edited by Jul 6, 2020, 1:04 PM

                @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
                5 out of 7
                • First post
                  5/7
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors