Using python, I am parsing multiple lines. Sometimes a line adds a few semicolons.
Examples of lines:
s1="1;Some text" s2="2;Some more text;;;;"
The number of additional semicolons varies, but if it is there, then it is at least two.
The following pattern matches s1, and s2 contains the added semicolons.
How to redo it to remove them?
pat=re.compile('(?m)^(\d+);(.*)')
source share