Using regex to detect a sku
<p>I'm new to regex and I have some trouble dectecting the sku (unique ids) of a product in a column. 
My skus can take any form: all they have in common basically is:</p>

<ol>
<li>to be words made of a combination of letters and numbers</li>
<li>to have 6 characters</li>
</ol>

<p>Here is an example of what I have in my column:</p>

<pre><code>LX0051
N41554
shoes
handbag
1B1F25
1V1F8L
store near me
M90947
M90844
</code></pre>

<p>How can I identify the rows that contain a sku using regex?</p>

<p>If I understand correctly you mean that it must have at least on digit, and at least one letter and be exactly 6 characters... Try</p>

<pre><code>^(?=.*\d)(?=.*[a-z])[a-z\d]{6}$
</code></pre>

<p>It uses two look-aheads to ensure there's at least one digit and one letter in the string. then it simply matches 6 characters. (Remember the <code>i</code> flag if both common and capital letters should be allowed.)</p>

<p><a href="https://regex101.com/r/pO2aX9/2" rel="nofollow">See it here at regex101</a>.</p>

python regex