Using Regular Expressions to analyze your competitor’s anchors

Your competitors might be using a different keyword strategy than you are. How can you find out what they are doing?

Regular expressions allow you to search the text for patterns. This means that you can easily see if someone else has been copying your content without even having to read their posts!

I did this myself when I had to look through one of my client’s competitors. 

In this particular case, it was a porn site and the client wanted to know what his competitors were doing for the anchor porn hd.

Since I have some experience in …

Introduction to regular expressions

Basic idea

A regular expression is a notation to represent standards in strings. It serves to validate data entries or to search and extract information in texts

It is just a series of characters which define an abstract search pattern. In a nutshell, most search engines perform such functions as search for specific words, phrases, and webpages, or find and replace operations on text. Essentially, it is a mathematical technique developed by formal language and computer science experts.

The process of generating the patterns can be a complex algorithm based on mathematical principles. A Regex is simply a string containing …

Regular expressions in Python: module re

Python doesn’t have a literal syntax for regular expressions, as it exists in Perl, JavaScript and Ruby (e.g. /d+/). The re module functions accept a string representing the regular expression. It is recommended to prepend the string with r’…’ to indicate a raw string, avoiding conflicts between Python’s escape sequences (like \b which is the ASCII backspace character) and the regex metacharacters (where \b means word boundary). See an example of using the match function:

import re
re.match(r'\d{4}$', '1234')
<_sre.SRE_Match object at 0x101161d30

functions × methods¶
If regular expressions are constant and will be used many times, it is worth …