• Login
Community
  • Login

Regex: Replace after I between tags

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 182 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.
  • V
    Vasile Caraus
    last edited by May 27, 2021, 9:43 AM

    I have this title, translated in Belarusian.

    <title>Divano | Я хачу паставіць</title>
    <title>America | ў пачатку радка</title>
    <title>America | сёння яны едуць у амерыку</title>

    I want to become:

    <title>Divano | My name (en)</title>
    <title>America | My name (en)</title>
    <title>America | My name (en)</title>

    This is the solution, maybe someone need it:

    Search: <title>.*\|\K(.*)(</title>)
    Replace by: \x20My name (en)\x20\2

    1 Reply Last reply Reply Quote 1
    • A
      Alan Kilborn
      last edited by May 27, 2021, 11:35 AM

      Probably we don’t need postings of random regex replacement solutions.

      1 Reply Last reply Reply Quote 1
      • A
        Alan Kilborn
        last edited by May 27, 2021, 12:38 PM

        Plus, it doesn’t work like you say anyway. :-(

        If you use literal ( or ) in your replace expression, you must escape them as \(, \) or they do not appear!

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