-3

I have these 3 lines. The words in the second line are missing html tags.

<p class="mb-40px">ARTICOL START</p>
ARTICOL START
<p class="mb-40px">ARTICOL START</p>

I need to make a regex that cand find the lines that doesn't have html tags, and add tags to it:

My regex is not very good, because the words doesn't have space before or after it

FIND: ^(ARTICOL START)\s+

REPLACE BY: <p class="mb-40px">\1\</p>

3
  • 1
    So all the lines you want to find are just ARTICOL START preceded/followed by nothing in the same line? Just use ^(ARTICOL START)$ if so.
    – Destroy666
    Commented Apr 19, 2023 at 7:14
  • yes, those lines
    – Just Me
    Commented Apr 19, 2023 at 7:15
  • thanks a lot @Destroy666
    – Just Me
    Commented Apr 19, 2023 at 7:24

1 Answer 1

0
  • Ctrl+H
  • Find what: (ARTICOL START)(?s)$
  • Replace with: <p class="mb-40px">\1\</p>
  • CHECK Wrap around
  • CHECK Regular expression
  • UNCHECK . matches newline
  • Replace all

@Destroy666 Alternative, you can use simple:

  • Find what: ^(ARTICOL START)$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .