Community
    • Login

    put capital after a tag

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    11 Posts 4 Posters 7.0k 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.
    • Pouemes44P
      Pouemes44
      last edited by

      hello
      i would to put in capital the letter which is just after tag <h1>
      i have a lot of <h1> tag with different letters after, not always the same
      is there a solution with notepad++
      thanks

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Pouemes44
        last edited by

        @kat75

        As is usually the case, supplying some real data would have helped clarify your situation, but I found that if I took this made-up data:

        <h1>hello</h1> and <h1>there</h1> or <h1>kat75</h1>

        I could change it with a Replace-All action into this:

        <h1>Hello</h1> and <h1>There</h1> or <h1>Kat75</h1>

        with this replacement:

        Find-what: <h1>(.)
        Replace-with: <h1>\U\1
        Search mode: ☑ Regular expression -AND- ☐ . matches newline

        The key part here is obviously the \U (indicating what follows should be converted to uppercase) in the Replace-with.

        1 Reply Last reply Reply Quote 1
        • Pouemes44P
          Pouemes44
          last edited by

          thanks scott
          it works fine
          great thanks

          1 Reply Last reply Reply Quote 1
          • Scott SumnerS
            Scott Sumner
            last edited by

            More information on these case conversions may be found here in the section on “Boost”.

            1 Reply Last reply Reply Quote 0
            • guy038G
              guy038
              last edited by

              Hello, @kat75, @scott-sumner and All

              And if you want to normalize the text, between the starting and closing tag <h1>, in order to obtain :

              • A first capital letter

              • All the subsequent letters lower-case

              Just use the regex, below :

              SEARCH (?-s)(?<=<h1>)(.)(.*?)(?=</h1>)

              REPLACE \u\1\L\2

              For instance, the line :

              <h1>sMalL</h1>   <h1>tESt</h1>
              

              would be replaced, as below :

              <h1>Small</h1>   <h1>Test</h1>
              

              Remarks :

              • The replacement \U\1\L\2 could have been used, as well ! In fact, the next global case modifier \L stops the previous case modifier action.

              • Now, let’s suppose the replacement \u$0 OR \u\1\2 . Then, only the first letter, of the text, would be changed upper-case. Similarly, the \l form changes the following single character lower-case.

              • For an equivalent regex, using the form \U, you would have needed the regex \U\1\E\2, because the syntax \E, when used in replacement, stops the global case modifiers \L and \U

              Cheers,

              guy038

              1 Reply Last reply Reply Quote 0
              • Pouemes44P
                Pouemes44
                last edited by

                thanks scott and guy

                1 Reply Last reply Reply Quote 0
                • Pouemes44P
                  Pouemes44
                  last edited by

                  Hello
                  i have used with success
                  Find-what: >(.)
                  Replace-with: >\U\1
                  Search mode: ☑ Regular expression -AND- ☐ . matches newline
                  to put in uppercase all the letters after >

                  i would now to put in uppercase all the letters after a . and a space

                  i have read the help but dont succeed
                  i have tried
                  Find-what: . (.)
                  Replace-with: . \U\1
                  Search mode: ☑ Regular expression -AND- ☐ . matches newline

                  but not work

                  1 Reply Last reply Reply Quote 0
                  • guy038G
                    guy038
                    last edited by guy038

                    Hi, @pouemes44,

                    I supposed that it does not work because you forgot to escape the dot regex symbol, in the search part, in order that the regex engine looks for a literal dot character !

                    So, try this S/R, below :

                    SEARCH (?-s)\.\x20(.)

                    REPLACE .\x20\U\1

                    Click, either, on the Replace or Replace All button

                    Notes :

                    • You may use, of course, a simple space character, instead of the \x20 syntax !

                    • The (?-s) modifier forces the regex engine to consider that the . matches newline option as to be disabled, even it’s checked, in the Find/Replace dialog !


                    An other form could be used :

                    SEARCH (?-s)(?<=\.\x20).

                    REPLACE \U$0

                    Notes :

                    • This time, the regex searches a single standard character, ONLY IF it is preceded by a literal dot and a space character ( positive look-behind )

                    • In replacement, the whole regex match ( $0 ), is just rewritten, in uppercase

                    • With that second S/R, you must, exclusively, use the Replace All button, although I don’t understand, clearly, the reason why :-))

                    Cheers,

                    guy038

                    1 Reply Last reply Reply Quote 0
                    • Pouemes44P
                      Pouemes44
                      last edited by

                      thanks guy, with your explanations i continue to learn :-)

                      1 Reply Last reply Reply Quote 0
                      • Pouemes44P
                        Pouemes44
                        last edited by

                        hello all
                        just another question
                        how to replace in uppercase all more special characters (accent, cyrillic, chinese, hindi etc)
                        by example é by É, б by Б etc
                        \U replace in uppercase only common letters
                        some ideas?
                        thanks

                        1 Reply Last reply Reply Quote 0
                        • Star XS
                          Star X
                          last edited by

                          Hi,

                          follow below steps

                          select all ctrl+A
                          select TextFx from the top Menu
                          then select TextFx Characters
                          then select Proper Case and it will change all first letters of every line to Upper Case

                          Cheers,

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