Posts tagged ‘regex’

Ultimate WordPress search and replace / String replacement & removal

Written August 13th, 2011

One of the most useful features of Automated editor is its search and replace function. You can set this up in a rule and use either replace one string with another directly, use regex to find matches and then replace them, or do the same to remove strings. Furthermore you can choose to just replace or remove a specific instance or all (e.g. replace 2nd instance or all instance’s of string ‘x’ with ‘y’) AND ALL THIS CAN BE RE-RUN AUTOMATICALLY!

There are a few important things to remember when using string/regex search & replace/remove within AutomatedEditor:

Remember its the HTML content of your posts Search and replace operates on

  • You will need to make sure you remember to switch tabs to “HTML” in the add new/edit posts page if you want to see the HTML and know what to replace. 
  • For example a string may appear one way in the browser (Visual Tab) and another in the source, Automated Editor plugin works on the source, a lower level to give you more control.
  • Check out this post for more information on using regex to replace specific html in automated editor rules
  • Search and replace is Case Sensitive by default

    • This lets you be more specific with your search and replace within the plugin
    • Use multiple versions of rules or regex rules if you need to target both cases 

     

    So remember, string replace is case sensitive, use spaces at the start of strings to get specific words and other similar tricks, triple think through your automation rules to avoid nearly-infinite loops and ask if you need more help!!

Parsing HTML, regex expression’s in Automated Editor Rules

Written August 13th, 2011

Looking to replace specific html with Automated Editor? It can do that quite well. Equipped with both string replacement and regex rule match replacement options you should be able to achieve almost any automatic string operation you need to with the plugin. It does it automatically too, did we say?

Anyhow for those who need a bit of inspiration on how best to replace a specific html element, or wanting some more information on how Automated Editor parses the HTML of wordpress posts you have hit the right page, here we are going to discuss in more detail the process of cutting only the specific bit of the post you want, or replacing (it removes or replaces…)

Read the rest of this entry »