字符串表达式下面包含两个IP编号。
我需要提取它们并复制整个字符串。因此,两个IP地址都包含在单独的字符串中,每个字符串都是相同的,除了它们包含的IP。
在涉及正则表达式的python中执行此操作的资源效率最高的方法是什么?
P.S。:下面文本中的IP地址可能不是真正的IP,但在问题中你可以假设有有效的IP地址。您可以假设将有数千个这样的插入语句,其中IP地址必须被拆分。
INSERT INTO DemandTable
(
[FullName], [ServerName],
[ServerType], [Ram],
[Processor], [Core],
[DataDiscCapacity], [BootDiscCapacity],
[OperatingSystem], [SystemDate],
[IP]
)
VALUES
(
'Lucky Look', 'FILE',
'APPLICATION', '4',
'2, '2',
'859.9951171875', '39.482421875',
'Windows Server', 'Wednesday, March 5, 2014 8:37:48 AM EET',
'179.13.9.111, 179.17.0.10'
)
所以OUTPUT应该是:
INSERT INTO DemandTable
(
[FullName], [ServerName],
[ServerType], [Ram],
[Processor], [Core],
[DataDiscCapacity], [BootDiscCapacity],
[OperatingSystem],[SystemDate],
[IP]
)
VALUES
(
'Lucky Look','FILE',
'APPLICATION','4',
'2,'2',
'859.9951171875','39.482421875',
'Windows Server','Wednesday, March 5, 2014 8:37:48 AM EET',
'179.13.9.111'
)
INSERT INTO DemandTable
(
[FullName], [ServerName],
[ServerType], [Ram],
[Processor], [Core],
[DataDiscCapacity], [BootDiscCapacity],
[OperatingSystem], [SystemDate],
[IP]
)
VALUES
(
'Lucky Look','FILE',
'APPLICATION','4',
'2,'2',
'859.9951171875','39.482421875',
'Windows Server','Wednesday, March 5, 2014 8:37:48 AM EET',
'179.17.0.10'
)