У меня есть текст в переменной, как показано ниже:
4.1.6.1 Display of user roles and system versions
[4.01.070]
It must be possible for a user logged into a named XXXXXX project,
to have all user information and all granted user roles displayed in a simple way.
An example of the displayed information is displayed below:
User Name: XXXX
Full Name: XXXXX XXXX
e-Mail: XXXX@XXXXXX.com
Status: Active
Deactivation Date: 23 Marts 2028
Granted User Roles:
Test Case Author
Requirement Author
Release manager
Description:
Please note this user was trained in XXXXX in spring 1903.
[4.01.072]
When pressing the About button, the following information should be shown:
iAuthorize DLL version: [Major].[Minor].[Bug].[0]
Workflow Script version: [Major].[Minor].[Bug]
Std. Template version: [XXXXX VX or XXXXXX VX]
The HP XXXX XXXXX version should be the name of the item called "XXXXX Version" on the XXXXX project list.
В приведенном выше тексте мне нужно узнать, сколько раз встречалась определенная строка шаблона "[x.xx.xx]".
В вышеприведенном случае 2 раза они произошли.
1-й - [4.01.070], а второй - [4.01.072]
Я хочу вывод, что-то вроде ниже:
2 найденных случая:
1-й случай:
Имя: 4.01.070 Содержимое:
It must be possible for a user logged into a named XXXXXX project,
to have all user information and all granted user roles displayed in a simple way.
An example of the displayed information is displayed below:</p>
<pre><code>User Name: XXXX
Full Name: XXXXX XXXX
e-Mail: XXXX@XXXXXX.com
Status: Active
Deactivation Date: 23 Marts 2028
Granted User Roles:
Test Case Author
Requirement Author
Release manager
Description:
Please note this user was trained in XXXXX in spring 1903.
2-й случай:
Имя: 4.01.072
Содержание:
When pressing the About button, the following information should be shown:
iAuthorize DLL version: [Major].[Minor].[Bug].[0]
Workflow Script version: [Major].[Minor].[Bug]
Std. Template version: [XXXXX VX or XXXXXX VX]</p>
<pre><code>The HP XXXX XXXXX version should be the name of the item called "XXXXX Version" on the XXXXX project list.
Пожалуйста, сообщите.
С уважением, Срихари