Community

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

    How can I search and replace all all text within a string, such as style="height: width:;"

    Help wanted · · · – – – · · ·
    2
    3
    56
    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.
    • Ali Hussain
      Ali Hussain last edited by

      <br>
      -ubiquitin ligase essential role in degradation of viral proteins and attachment to MHC complex I
      <div>
      -Ubiquitin ligase
      <i>
      initiates the UPP
      </i>
      by recognizing specific protein substrates and
      <b>
      catalyzing the attachment of ubiquitin
      </b>
      ; ubiquitin tagged proteins → broken down by proteasome to peptide fragments which can be recycled into amino acids
      </div>
      <div>
      -peptide fragments coupled to MHC in endoplasmic reticulum → CD8+ T cells can recognize and trigger apoptosis
      </div>
      <div>
      <img class=“” src=“L10238.jpg” style=“height: 446px; width: 700px;”>
      <img class=“” src=“L24978.jpg” style=“height: 842px; width: 484px;”>
      <br>
      </div>

      The above is an example, how can I use the search and replace that string and remove it such as:
      <img class=“” src=“L10238.jpg”>
      <img class=“” src=“L24978.jpg”>

      1 Reply Last reply Reply Quote 0
      • guy038
        guy038 last edited by guy038

        Hello, @ali-Hussain and All,

        I suppose that the following regex S/R should do the job :

        SEARCH (?-s)(<img class.+?)\x20style=.+?>

        REPLACE \1>

        Of course, select the Regular expression search mode and, possibly, the Wrap around option


        Even if two of more <img .....> exist on a single line, it will change :

        <img class="" src=“L10238.jpg” style=“height: 446px; width: 700px;”>  <img class="" src=“L24978.jpg” style=“height: 842px; width: 484px;”>
        

        Into :

        <img class="" src=“L10238.jpg”>  <img class="" src=“L24978.jpg”>
        

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 2
        • Ali Hussain
          Ali Hussain last edited by

          Thank you much!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors