I would like to ask you to extract only the English part of the Python string.

Asked 2 years ago, Updated 2 years ago, 84 views

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

2022-09-20 15:07

1 Answers

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)


2022-09-20 15:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.