String values with Regular Expressions

Hi everyone,

I’m trying to get all values starting with “L” or “B” followed by three digits.
I’ve been looking information about regular expressions but my knowledge about regular expressions a is very limited. I used some metacharacters but I’m not really sure what I’m doing.

Thank you in advance.

@JC.Moreno Try using this expression

(L|B)\d{3}

(L|B) = L or B
\d = any digit
{3} = exactly amount of \d

Example

2 Likes

Hi 3Pinter,
Thank you for helping me!

I tested but it doesn’t work. Surely, I’m doing something wrong. :pensive:

That is because everything between ( ) is a ‘group’. So place a set of () around it.

((L|B)\d{3})

returns
group 1: L300
group 2: L

Thank you very much 3Pinter.