Reqtify regex issue

275 Views Asked by At

I've an issue with reqtify in order to remove a part of text.

See below an extract of the intermediate file generated by Reqtify: heading 1 5. Bug fixing requirements heading 2 5.1 Detection bullet:style1 1. The representative shall identify them bullet:style1 2. Based on the following principles: bullet:style2 1. Principle 1 bullet:style2 2. Principle 2 bullet:style2 3. Principle 3 NOTE NOTE This can block delivery bullet:style1 3. The supplier shall kept in database bullet:style1 • Clause 1 bullet:style1 • Clause 2 heading 2 5.2 Bug fixing meeting

I used the following regex in reqtify: ^bullet:style1\s*(\d.)+\s(.*)((?:(?!^bullet:style1\s*\d.|^heading).*(?:\n|$))*)

I correctly capture the three requirements but the text contains for the 2nd and 3rd requirements, the term "bullet:style1" or "bullet:style2" or the term "NOTE" ...

I've tried to remove it by using a sub-expression without success ^(?:bullet:style\d\s*|NOTE\s*)*(.*)

Could you please tell me, what's wrong in my sub-expression ?

By advance, thanks for your help.

NB: The result, I'm looking for:

1st requirement: "1. The representative shall identify them" 2nd requirement: "2. Based on the following principles:

  1. Principle 1
  2. Principle 2
  3. Principle 3 NOTE This can block delivery"

3rd requirement: "4. The supplier shall kept in database • Clause 1 • Clause 2"

NB: I've used the following post to build the 1st regular expressions https://stackoverflow.com/questions/71724961/regexe-reqtify-capturing-multilines-requirements

NB#2: See attached the captures of my reqtify project and the associated results

Reqtify type definition and field attribute - From 1 to 4

Reqtify output without the substring application - Picture #5

Reqtify output with substring application on Field#3 - Picture #6

Reqtify type definition Reqtify type definition - Field#1 ID [Reqtify type definition - Field#2 Text3 [Reqtify type definition - Field#3 Text4 Reqtify Output 1 without substring Reqtify Output 2 with substring applied to Field #3

0

There are 0 best solutions below