Hi, everyone. I'd like to extract a specific string with Python. I want to extract only the English part.
Question number 1 (only the English part changes, and the rest are all the same structure.)
[Information] ABCDEF (ABCDEF) Kanadara Maba (ZXC) Saazacha
I'd like to bring only the English equivalent of the parentheses (ABCDEF) before here.
Question number 2 (only the English part changes, and the rest are all the same structure.However, there may be several numbers such as A, B, C, D, and E.)
[Information] ABC, DEFG, HIJKLM Kanadara Mabasa
I'd like to print out or import ABC/DEFG/HIJKLM. Python masters, I'd appreciate it if you let me know.
string extract python
You need to know what format the data comes in when you print it out separately.
If you have a particular format, you can divide it by that and extract it.
import re
keyword = 'asdfㄴㄹ124124'
keyword = re.sub('[^a-zA-Z]', '', keyword)
© 2024 OneMinuteCode. All rights reserved.