Antoine Eripret Profile picture
Apr 6, 2021 14 tweets 6 min read Read on X
⚡️ Expresiones regulares (REGEX) ⚡️

En el🧵de hoy, te voy a enseñar algunas expresiones regulares simples para que puedas empezar a usarlas ya. Ahorrán mucho tiempo, y dominar algunas te ayudará.

No para posicionar, pero para trabajar de manera más eficiente.
🤷‍♂️¿Que son las expresiones regulares (REGEX)? 🤷‍♂️

Sirven para describir cadenas de texto, números y caracteres especiales con el fin de buscarlas o manipularlas.

Se pueden usar en la gran mayoría de las herramientas, como por ejemplo Sheets:

Las REGEX pueden asustar, pero te voy a detallar cuáles son las más comunes y qué hacen.

Usaré regex101.com en mi pantallazos, que te permite validar tus REGEX de manera sencilla.
1. Punto (.)

Representa cualquier carácter.
2. Estrella (*)

Indica que el elemento al que sigue se puede repetir 0 o más veces. Si lo combinamos con el punto, significa "cualquier cadena".

Similar: el más (+) que indica 1 o más veces.
3. Barra vertical (|)

Significa OR. Permite indicar varios valores que puedes estar buscando.

En mis ejemplo, ves que la segunda opción no coincide con mi REGEX porque la extensión (co.uk) no está dentro de mis opciones.
4. Barra invetida (\)

Permite "escapar" un carácter para que se interprete literalmente (no con su significado REGEX).

En mi ejemplo, escapo el punto: quiero un punto sí o sí.
5. Signo de interrogación (?)

Indica que el elemento al que sigue es opcional.

En mi ejemplo, la barra final es opcional, por lo tanto mi REGEX coincide tanto con el primer texto como el tercero.
6. Barra invertida + d (\d)

Indica un carácter númerico.

Si lo combiamos con +, indicamos que queremos una cadena de 1 o varios dígitos.
7. [a-z]

Indica una letra (minúscula).
* si quieremos una letra mayúscula, tenemos que usar [A-Z]
* si queremos una letra mayúscula o minúscula, tenemos que usar [a-zA-Z]
8. {número}

Indica que el elemento al que sigue se repite X veces.

Por ejemplo, si buscamos una URL con 3 números:
** Caso práctico **

Aplicamos todo lo que acabamos de aprender. Tengo tres URLs y quiero capturar los dígitos situado al final de las URLs, si se trata del blog.

No puedo usar \d+ porque capturaría también el número si el contenido no pertenece al blog 🤔
Si modificamos un poco nuestra REGEX, podemos capturar lo que nos interesa.

.* : lo que sea
liligo\.(fr|es): liligo.fr o liligo.es
\/blog\/: carpeta blog
[a-z-]+: palabras separadas por un -
(\d+)\: lo que queremos (por eso usamos paréntesis)
¿Te parece complicado?

Es normal, al inicio aprender las REGEX cuesta . Usa regex101.com para practicar y irás mejorando poco a poco.

Y podrás trabajar de manera más eficiente ⚡️

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Antoine Eripret

Antoine Eripret Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @antoineripret

Apr 13, 2023
🤓 Google Sheets formulas every SEO should know 🤓

Let's go through the most common formulas you need to master to work quicker.

Most of them can also be used in Excel, but not all of them.
1. VLOOKUP

THE formula you have to master because it allows you to merge data from different tables. Very useful to combine Search Console and Analytics data, for instance.

You have to master it. Image
2. FILTER

I've explained everything about this formula in a separate thread:
Read 15 tweets
Apr 12, 2023
🛑 SEO tip: Never assume search intent 🛑

These three queries have the same search intent but, for some reason, Google thinks that "python playground" is different. Bing as well.

Should have I done it manually, I'd have created one URL to target these queries. Image
Funny to see how a website is ranking on both (supposed) intents, with two versions of the same functionality.

While others are just present on a part of the demand.

Be smart and look at SERP data before taking decisions! Image
PS: Screenshots from @keywordinsights
Read 4 tweets
Apr 11, 2023
🛣️ How to create an efficient SEO roadmap 🛣️

SEO theory is relatively easy, but pushing changes into production is harder. How many ideas have you got? How many will be live?

Let me explain how I manage to define & plan an SEO roadmap with other teams! Image
Foremost, it's important to keep track of all the ideas you have. A simple to-do list is enough.

A sort of brain dump to ensure that even if you can't implement them now, you never forget an idea that occurred to you. Image
When comes the planning phase (frequency depends on how the organization operates), take these ideas and:

* Create a brief summary (2-3 sentences)
* Assign an SEO priority
* Ask IT to assign a complexity

Based on these two criteria, you can define a prioritization. Image
Read 13 tweets
Apr 4, 2023
🚦 Find cannibalization at scale using GSC 🚦

Keyword cannibalization means that you have more than one content ranking. It's often a situation you want to avoid.

Easy to spot when you check a couple of URLs, but how to handle thousands of URLs?

Let me explain! Image
When you intend to spot a cannibalization, you can use an external tool such as @semrush.

Head to the Keyword Gap tool and introduce the two URLs you wish to compare.

Great if you don't have access to GSC data, for instance. Image
If you have access to GSC, you can achieve the same using first-party data.

* Filter on a specific query (you can also use a REGEX)
* Go to the "Pages" tab

You can see quickly see which URLs are ranking for this query. Easy, right? Image
Read 11 tweets
Mar 9, 2023
🕵️ How can you spy on a competitor's content strategy? 🕵️

Your strategy must never be a simple pale copy of what others are doing, but it's always a good idea to know what they are up to.

Let me show you, with a real example, how you can generate insights quickly. Image
Let's assume we're working in the travel industry and one of our competitors is Skyscanner.

We want to understand what they are doing on their blog and generate some insights based on the data we have at our disposal. Image
First step: get an exhaustive list of their URLs

This could be done through a crawl, but I'd rather get the list from a sitemap. Not always doable, but in this case, it was easy to find what I was looking for. Image
Read 11 tweets
Feb 7, 2023
🚨 New article: content rehydration and SEO 🚨

JavaScript SEO is not going away, and is often challenging.

If you want to know what is content hydration and how it can cause huge traffic drop, check my article or read the thread below

aeripret.com/content-rehydr… Image
Content rehydration is a process that occurs when a website, built with a JavaScript framework, such as Angular or React, dynamically updates the content on a page without requiring a full-page refresh.

Why using rehydration instead of relying only on SSR? It is faster!
What is the issue with content rehydration?

It will add a script to the raw response sent by your server with all the required code to make the application dynamic. Out-of-the-box, this script can easily represent more than 90% of the total HTML size. Image
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(