Reputation: 602
Consider the below lines:
यदि रेनेसाँ मिथ्या है तो इतिहास क्या है? जब हम इसके स्वाभाविक तत्वों को देखें <FIL\>
यदि रेनेसाँ मिथ्या है तो इतिहास क्या है? जब हम इसके स्वाभाविक तत्वों को देखें LIF
यदि रेनेसाँ मिथ्या है तो इतिहास क्या है? जब हम इसके स्वाभाविक तत्वों को देखें
I want to write a regex that removes lines which a) do not contain Devanagari characters b) except some exact tags ( like, <FIL\>
).
So basically, it should not match line 1. and 3. but only line 2.
I tried merging a capturing group inside a negated set [^ँ-ॿ(FIL)]
but apparently that doesn't work. I tried other combinations of such kind but couldn't reach the solution.
Upvotes: 0
Views: 70
Reputation: 786011
In C# you can use this regex:
^(?!.*?<FIL\\>)(?=.*?[^\p{IsDevanagari}\p{P}\s]).+$
Upvotes: 2