Community
    • Login

    Find those html tags that contain only 3 words (with regex)

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 199 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.
    • Neculai I. FantanaruN
      Neculai I. Fantanaru
      last edited by

      Hello. For example.

      <p class="pintem">Since you loose</p>

      <p class="pintem">Truly creative works remain exclusively in the care of the creative man</p>

      Is it possible to find only those html tags that contain only 3 words (with regex). In my case, only the first line?

      I made a regex, but doesn’t work

      FIND: (<p class="pintem">)\w{1,3}(</p>)

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Neculai I. Fantanaru
        last edited by

        @neculai-i-fantanaru said in Find those html tags that contain only 3 words (with regex):

        Is it possible to find only those html tags that contain only 3 words (with regex). In my case, only the first line?

        Yes.

        Find: (?-is)<p class="pintem">\w+?\h\w+?\h\w+?</p>

        Neculai I. FantanaruN 1 Reply Last reply Reply Quote 4
        • Neculai I. FantanaruN
          Neculai I. Fantanaru @Alan Kilborn
          last edited by

          @alan-kilborn said in Find those html tags that contain only 3 words (with regex):

          (?-is)<p class=“pintem”>\w+?\h\w+?\h\w+?</p>

          thank you

          Neculai I. FantanaruN 1 Reply Last reply Reply Quote 1
          • Neculai I. FantanaruN
            Neculai I. Fantanaru @Neculai I. Fantanaru
            last edited by

            @neculai-i-fantanaru

            Try this:

            <p class="pintem">(?:\W*\w+){3}\W*</p>

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