• Login
Community
  • Login

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

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 2 Posters 218 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.
  • N
    Neculai I. Fantanaru
    last edited by Apr 2, 2022, 7:46 PM

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

    A 1 Reply Last reply Apr 2, 2022, 8:01 PM Reply Quote 0
    • A
      Alan Kilborn @Neculai I. Fantanaru
      last edited by Apr 2, 2022, 8:01 PM

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

      N 1 Reply Last reply Apr 2, 2022, 8:21 PM Reply Quote 4
      • N
        Neculai I. Fantanaru @Alan Kilborn
        last edited by Apr 2, 2022, 8:21 PM

        @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

        N 1 Reply Last reply Apr 3, 2022, 12:26 PM Reply Quote 1
        • N
          Neculai I. Fantanaru @Neculai I. Fantanaru
          last edited by Apr 3, 2022, 12:26 PM

          @neculai-i-fantanaru

          Try this:

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

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