Regex for paragraph

hi Team
I want Regex query for
9.2.2.1 Internal audit program
VWAG requires a yearly Supplier Self Audit (VA/SL) acc. Formel-Q-capability (Chapter 3)), a Self Audit has valid time period of max. 12
months. A specific Self-Audit-Format is supplied on Volkswagen Group B2B www.vwgroupsupply.com “Format for Supplier Self Audit”
Supplier Self Audit (VA/SL) must be conducted by certified VDA 6.3 auditors (see auditor qualification in Section 3.2 of Formel-QCapability).
Formel-Q-Capability-Appendix must be considered.
In case of D/TLD-marked parts supplied to VWAG, a D/TLD-Supplier-Self-Audit according to Formel-Q-capability is required within a 12
month period. (Formel-Q-konkret, Chapter 4.3.1: “D/TLD verification”)
Where the organization is responsible for software development, a maximum validity of a software development capability assessment
on VWAG projects shall not exceed the time period indicated in the Formel Q-Capability Software (chapter 3.4).
The software development capability assessment scope is indicated in Formel Q-Capability Software (Chapter 6.2).
9.2.2.4 Product audit
Product Audit acc. Formel-Q-Capability (Chapter 4) – Product Audit
The Supplier is required to conduct Product Audits according to VDA 6.5
Product Audit shall take place at least every 12 months for each product manufactured as a Series Production part.
For any A and B-faults as well as systematic C-faults caused by the supplier, the supplier shall immediately inform the Supplier Quality
department of the Customer by reporting the issue. The implementation of further necessary actions is to be coordinated.
10.2.5 Warranty management systems
The process of Failure Analysis including NTF shall be implemented.

I want all paragragh which is below no9.2.2.4
All the numbers i am taking from excel I want to search this no and take all the text which is below in the no without heading

Hi,

How about the following?

 System.Text.RegularExpressions.Regex.Match(yourString,"9.2.2.4[\s\S]*?(?=\n\d+(\.\d+)*\s|$)").Value

Regards,

Product Audit acc. Formel-Q-Capability (Chapter 4) – Product Audit
The Supplier is required to conduct Product Audits according to VDA 6.5
Product Audit shall take place at least every 12 months for each product manufactured as a Series Production part.
For any A and B-faults as well as systematic C-faults caused by the supplier, the supplier shall immediately inform the Supplier Quality
department of the Customer by reporting the issue. The implementation of further necessary actions is to be coordinated
I only want this Please removing the heading in your output

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=9\.2\.2\.4\s)[\s\S]*?(?=\n\d+(\.\d+)*\s|$)").Value

Regards,

I think this will not work for dynamic numbering? or it work
numbering which i have given you is dynamic
i want paragraph as output numbering we will take from excel to search the text

Create a string varibale give your regex expression as string inside the variable with numbers dynamically. like

System.Text.RegularExpressions.Regex.Match(yourString,"(?<="+FIrstNUmber"+"\."+SecondNumber+"\.2\.4\s)[\s\S]*?(?=\n\d+(\.\d+)*\s|$)").Value

it just example. try like this

@Kuldeep_Pandey
Regex pattern: 9\.2\.2\.4\s+(.+?)(?=\d+\.\d+\.\d+\.\d+|\Z)

Explanation of the pattern:

  • 9\.2\.2\.4 matches the specific number “9.2.2.4”.
  • \s+ matches one or more whitespace characters.
  • (.+?) captures one or more characters lazily (non-greedy) into a group.
  • (?=\d+\.\d+\.\d+\.\d+|\Z) is a positive lookahead assertion that matches either another number pattern (e.g., “9.2.2.1”) or the end of the string.

Hi,

If you need to handle “9.2.2.4” part as dynamic, the following will work.

strNumber="9.2.2.4"

Then

System.Text.RegularExpressions.Regex.Match(yourString,"(?<="+System.Text.RegularExpressions.Regex.Escape(strNumber)+"\s)[\s\S]*?(?=\n\d+(\.\d+)*\s|$)").Value

Regards,