我是正则表达式的新手。我想解析以下数据。我想出了一些似乎适用于 sublime 的正则表达式,但是当我在 Visual Studio 中对其进行测试时,它就不起作用了。我想知道是否有人可以提供一个简单的例子或指导如何使用正则表达式解析它。它一定很简单,一定是我理解的错误,所以提前道歉。
这是我正在处理的数据。
Fri 11:00 - 12:00
Max Agents: 1
Min Agents: 2
Total Calls: 3
Answered Calls: 4
Abandoned Calls: 5
Average Time to Answer (secs): 6
Longest Time to Answer (secs): 7
Average Time in Call (secs): 8
Longest Time in Call (secs): 9
Average Time before Abandon (secs): 10
Per agent statistics:
Agent: 1001
From Direct Call:
Total Calls Answered : 11
Average Time in Call (secs) : 12
Longest Time in Call (secs) : 13
From Queue:
Total Calls Answered : 2
Average Time in Call (secs) : 14
Longest Time in Call (secs) : 15
Agent: 1002
From Direct Call:
Total Calls Answered : 1
Average Time in Call (secs) : 16
Longest Time in Call (secs) : 17
From Queue:
Total Calls Answered : 2
Average Time in Call (secs) : 18
Longest Time in Call (secs) : 19
Queue related statistics:
Total calls presented to the queue: 20
Calls answered by agents: 21
Number of calls in the queue: 22
Average time to answer (secs): 23
Longest time to answer (secs): 24
Number of abandoned calls: 25
Average time before abandon (secs): 26
Calls forwarded to voice mail: 27
Calls answered by voice mail: 28
Number of error calls: 29
这是唯一一个获得 Agent:1004 的部分。
Agent:.(?<agentNum>\d+)\n?((?:[a-z\s]+from.*\n)+\s(?:[a-z\s]+call.*\n)+)?((?:[a-z\s]+from.*\n)+[\n\s]+(?:[a-z\s]+call.*\n)+)?
我正在尝试提取不同属性的数据,例如总呼叫回答平均通话时间
等等 。我基本上想为这些字段提取数据并存储在一个表中。