I have a table where column A has values in '12:30:45' format. I want to create a column B where I only get the digits after the first colon of column A.

How do you use regex on python to extract only the digits after the first colon so that in the end, we get ':30:45'?

I've seen regex for extracting numbers, strings, split values between spaces, but couldn't find the one for extracting after colon.

I'm new to regex and any suggestions would be greatly appreciated.

You can use

`Series.str.extract`

with`regex`

to get the`:`

including:If you want to

keepthe numbers which don't have a`:`

, so you don't get a`NaN`

, use the regex fallback`|.*`

which you can read as:`or all`

: