Regex 我需要正则表达式来获取子字符串

Regex 我需要正则表达式来获取子字符串,regex,Regex,那是我的绳子。我需要在[dbo]之后首先使用子字符串。意思是ı需要表名和第二个日期时间。我需要两个正则表达式 输出 Started transaction at 10.12.2014 16:11:02 +02:00 UPDATE [dbo].[Urun] SET [Ad] = @0, [Kategori] = @1 WHERE ([Id] = @2) -- @0: 'Erkan' (Type = String, Size = 75) -- @1: 'Karabulut' (Type = St

那是我的绳子。我需要在[dbo]之后首先使用子字符串。意思是ı需要表名和第二个日期时间。我需要两个正则表达式

输出

Started transaction at 10.12.2014 16:11:02 +02:00
UPDATE [dbo].[Urun]
SET [Ad] = @0, [Kategori] = @1
WHERE ([Id] = @2)

-- @0: 'Erkan' (Type = String, Size = 75)

-- @1: 'Karabulut' (Type = String, Size = 50)

-- @2: '1' (Type = String, Size = 25)

-- Executing asynchronously at 10.12.2014 16:11:02 +02:00

-- Completed in 4 ms with result: 1

Committed transaction at 10.12.2014 16:11:02 +02:00

感谢您的帮助…

使用下面的正则表达式,从组索引1和2获取所需的字符串

"Urun" and "10.12.2014 16:11:02 +02:00"

增加了一个动词,因为我不知道你指的是哪个日期和时间

(?s)\[dbo\].*?\[([^\]]*)\].*?\d{2}\.\d{2}\.\d{4}\s+\d{2}:\d{2}:\d{2}.*?\b(\d{2}\.\d{4}\s+\d{2}:\d{2}:\d{2}\s+\S+)


(?s)
Dotall修饰符,它使正则表达式中的点与偶数换行符匹配。

这很好。祝你好运。你有什么问题吗,或者你只是希望我们为你做你的工作?时间不多。找不到合适的正则表达式。
(?s)\[dbo\].*?\[([^\]]*)\].*?\b(\d{2}\.\d{2}\.\d{4}\s+\d{2}:\d{2}:\d{2}\s+\S+)