Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Regex: Replace after I between tags

    Help wanted · · · – – – · · ·
    2
    3
    39
    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.
    • Vasile Caraus
      Vasile Caraus last edited by

      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
      • Alan Kilborn
        Alan Kilborn last edited by

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

        1 Reply Last reply Reply Quote 1
        • Alan Kilborn
          Alan Kilborn last edited by

          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
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors