Write regex or python function to parse a string

Job ID: 34397156

Budget: $30 – $250 USD

I have a list of strings (with random noise containing characters and numbers) that may contain a partial regex -formatted substring that need to be expanded. I need a single regex (OR a python function) that could expand these substrings into a list of numbers. The regex (or function) would take a single string and produce a list of numbers.

Example:

input -> output

IN: 105(lksdf)*123[4-8],
OUT: 1234,1235,1236,1237,1238

IN: (22*~.*567[568]-*)
OUT: 5675,5676,5678
IN: 1(9--++123[14])
OUT: 1231,1234

IN: .#$))(@#asb40[123],(?:\asb++..)*10(?:66|90)***
OUT: 401,402,403,1066,1090

IN: %%(!=:190[0-4]|ccc)(??=="",\d+)$$
OUT: 1900,1901,1902,1903,1904

IN: (++:\aa--,)*10(?:14|12)(ll:a\cc+)+*
OUT: 1014,1012

IN: (plvbd+)&&(#:10[1236]|44[01])(?:\d+)
OUT: 101,102,103,106,440,441

IN: 123?..***124[89],lkdflkdf)***(!!??:190[0-2])(dfdff--)*222
OUT: 1248,1249,1900,1901,1902

IN: (?:15[78]|17[23]),(?:\d+,)*15[14](?:,\d+)*
OUT: 157,158,172,173,151,154

IN: 125aa125[12345]
OUT: 1251,1252,1253,1254,1255

IN: a(v:190[0-3]|13[0-2])))fffggg*&^505
OUT: 1900,1901,1902,1903,130,131,132

IN: *(?:(?:17(?:0[0-2]|6[5-8]))))))
OUT: 1700,1701,1702,1765,1766,1767,1768

IN: (!!ll+=&&("":50[0-24-6]|61[02-4]))
OUT: 500,501,502,504,505,506,610,612,613,614

IN: (*#@%$505$@#102@#[234]***
OUT: N/A
Related categories: Python Regular Expressions