Nested comments aren't allowed in js and ts, are they? On Monday, August 17, 2020 at 10:53:37 AM UTC-4, vitalije wrote: > > re.compile(r'(/\*(:?.*?)\*/)') > > The inner comment text must be grouped separately to be able to apply *? > operator on just the inner characters. Without this grouping, *? operator > applies to all matched characters to the left. Your regex would match > smaller part if you have had nested comments. Like > /* first comment /* blah blah */ */ > > > > Vitalije > > > On Monday, August 17, 2020 at 3:49:13 PM UTC+2, Edward K. Ream wrote: >> >> I would like a regex that finds complete and *disjoint *typescript >> multiline block comments >> >> The following does not work, because the flags do not play well together. >> >> re.compile(r'(/\*.*?\*/)(.*)', re.DOTALL | re.MULTILINE) >> >> For example, even with .*?, the pattern will match the *entire* string: >> >> /* first comment */ >> body >> /* second comment */ >> >> The relevant code is in the bug-1617 branch. It's not pretty. >> >> I don't know of any elegant solution. Do you? >> >> Edward >> >
-- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/c1e7b266-7e1c-4d90-9eb6-ae2a202f62fbo%40googlegroups.com.