I need a php regex to match text that is not preceded by the name "Total" of "maximum" case insensitive in the text below.
[1]
[1m]
[1mk][1mks]
[1mark]
[1marks]
(1mk)
12mk
12 mark
13 mark
[Total: 15]
Total: 16 mark
Total 1 mark
Total 12 mark
Total: 9 mark
Total: 10 mark
[Total: 11 marks] Total 6 mark
maximum 5 marks
maximum:5 marks
Note: This text is in a one long line.
The regex should match the following
[1]
[1m]
[1mk][1mks]
[1mark]
[1marks]
(1mk)
12mk
12 mark
13 mark
I have tried this one but its not working
/(?<!Total\:\s|Total\s|maximum\s|maximum\:\s)[\[|\(]?([0-9]{1,2})(\s|(?=marks|mark|mks|mk|m|\]))?(\]|marks|mark|mks|mk|m)[\]|\)]?/i
EDIT
https://www.debuggex.com/r/yNNN_B3iQmGyYWoz
EDIT2 e.g '12 mark' should be returned only is its not "Total[:]\s+ 12 mark" or "maximum[:]\s+12 mark"