I am developing a sample code for my customer and haven't done programming in Python before. How do I use regex to extract text below?
RSH|^~\&|MIC|SCC|MS4OD|A|201804060738||ORU^R01|0137245|P|2.2
KID|||10552884||Fer^Huh^GRV||20223164433|M||W|193 Biop Mill
I want to extract 0137245 from the first row and 10552884 from the second row.
RSH|^~\&|MIC|SCC|MS4OD|A|201804060738||ORU^R01|0137246|P|2.3
KID|||10552885||Fer^Huh^GRV||2023164434|M||W|193 jason Mill
I want to extract 0137246 from the first row and 10552885 from the second row.
Example 3
RSH|^~\&|MIC|SCC|MS4OD|A|201804060738||ORU^R01|01372451.1|P|2.2
KID|1||10552884||Fer^Huh^GRV||20223164433|M||W|193 Biop Mill
I want to extract 01372451.1 from the first row and 10552884 from the second row.
Example 4
RSH|^~\&|MIC|SCC|MS4OD|A|201804060738||ORU^R01|01372451.1|P|2.2
KID|1|2|10552884||Fer^Huh^GRV||20223164433|M||W|193 Biop Mill
I want to extract 01372451.1 from the first row and 10552884 from the second row.
Any suggestions?