Assistance needed for regex python -
I have is a file which is shown below it is possible to make a regex expression
text 1 769 230 123 text 2 70 text 3 213 445 4 text 24356 text 5 1,2,4
to output, as shown here? <-> ['769', '230', '123'] ['70'] ['213', '445']
My current code as follows:
with open as output (filename, 'r') to the line output: a = line a = a.strip () # regex. compile here Print regex.findall (a)
no one would be very useful for my help or direction remove different number of commas in the following regex line, and then we
Import again Finance = "text 1 769 230 123" mat = again. Match (r '. *? ([Num = num] = num =' for num) = '. ( ','), * Nums = mat.group (1) .split ( ',') num num: Print Number
OUTPUT
769 230 123
Comments
Post a Comment