URL / CRM / Accounting

How to extract a YouTube video ID from a URL

2026-06-21
Task

A table contains youtube.com/watch?v=..., youtu.be/..., or /embed/... links. The import needs a separate youtube_id column.

Short answer

Create youtube_id from the URL and keep only the 11-character video identifier with a regular expression.

How to do it in Eofferix

  1. Upload the CSV or XLSX with video links and open the table editor.
    youtube_id column created from YouTube links in Eofferix
    The table shows the source URL and the output youtube_id column.
  2. Create youtube_id from youtube_url and add a Regular expression -> Remove everything except rule.
    Regular expression rule for YouTube video ID
    The rule keeps the 11-character fragment used as the video ID.
  3. Use [A-Za-z0-9_-]{11} as the pattern. For standard YouTube URLs it leaves only the video ID.
  4. Save the template and test watch?v=, youtu.be/, and /embed/ rows.

Before / after

The data below is a training example and does not belong to real user files.

Before

source data
skuyoutube_url
SKU-1001https://www.youtube.com/watch?v=iwGFalTRHDA&feature=related
SKU-1002https://youtu.be/n17B_uFF4cA

After

result
skuyoutube_id
SKU-1001iwGFalTRHDA
SKU-1002n17B_uFF4cA

Process data faster with Eofferix

Create a free account to automate catalogs and price lists around your own rules.

Sign up