Nummer aus der Zeichenfolge extrahieren
var num = txt.replace(/[^0-9]/g,'');
Disgusted Dogfish
var num = txt.replace(/[^0-9]/g,'');
// You will receive an error if there are non-numeric characters in the String.
String num = "5";
int i = Integer.parseInt(num);
str = str.replaceAll("\\D+","");
A B
1 V2
3 W42
1 S03
2 T02
3 U71
df['B'] = df['B'].str.extract('(\d+)').astype(int)
B
2
42
3
2
71