Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #91270
| From | jak <nospam@please.ty> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: [OT] Help for a RegEx |
| Date | 2023-08-16 21:24 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <ubj7p0$3dppf$1@dont-email.me> (permalink) |
| References | (4 earlier) <uahf52$vcci$1@dont-email.me> <877cqbveje.fsf@bsb.me.uk> <uak4dt$1f8eg$1@dont-email.me> <ubcp3g$280ql$1@dont-email.me> <ubfq6v$2qgsi$1@dont-email.me> |
MarioCCCP ha scritto: > On 14/08/23 10:37, jak wrote: >> MarioCPPP ha scritto: >>> On 04/08/23 02:26, Ben Bacarisse wrote: >>>> MarioCPPP <NoliMihiFrangereMentulam@libero.it> writes: >>>> >>>>> On 03/08/23 10:36, Paavo Helde wrote: >>>>>> <p (.|\r|\n)*?</p> >>>>> >>>>> intresting. I tried this one and it detects most of paragraphs, except >>>>> those that does not have attributes within the <p> opening tag. >>>>> >>>>> Is it there a way to also include those ones ? >>>> >>>> PH's regex insists on a space after the "<p". Whilst this is not >>>> exactly the same as requiring an attribute it will be effectively the >>>> same. You could try >>>> >>>> <p[ >](.|\r|\n)*?</p> >>>> >>>> but I can't stress enough -- none of this can really work in all cases. >>>> >>> >>> ok, tnx for the prudent disclaimer >>> >>> Your variant found 3883 matches against 3644 matches found by the >>> previous one. >>> >>> scanning visually the book, it seems this RegEx is able to find ALL. >>> >>> I'll try variants with h1...h10 to find headings also. >>> >>> Many thanks for this precious hint >>> >>> Now I try to better understand the Expression :D >>> >> >> Could I ask you if you could kindly provide a piece of text on which you >> are doing the tests? Thanks in advance. >> > > well, actually not : it's an .ODF book converted to .HTML, written in > LbO, with just a main structural index, headings untill Title3 rank, a > few tables, and some 300'000 words of text. But, being unpublished and > not going to be given away for free, I won't share the content. > > The <p> tags are often heavily loaded with font style attributes, and > some nested <span> tags, the text is also full of nested <i> and <b> > tags (italics and bold). It's a very large document, but not complex in > structure. Just badly designed (imvho). > For example LbO does not track smartly editings that could be > "collapsed". It just dumbly obey and records formatting command as they > are, It does not produce very "CLEAN" HTML. But I won't revise it > manually, it's huge. And actually the books to be analyzed and > steganized are SIX, not just one. > > I have decised to use a true XML parser though, even if the RegEx worked > well, the program is growing too complex to use string-only approeach, > and I need some true "dom-like" aware approach to edit nodes content. > > I am also considering to abandon GAMBAS and do that in Javascript, which > is able to act upon the HTML from inside and injecting stuff is native > at it. > > Sorry if my reply is a bit frustrating, but those six books are 30 years > of my life, I'heve poured blood in them :D > > > > > Hi Mario, absolutely no problem. Maybe I misunderstood the thread and I thought you refer to an XML document useful for debug. Practically a unique document that contains all the characteristics, peculiarities and exceptions of the XML that would allow an exhaustive debug of a parser. If I had sensed that you refer to your personal document, then I would not have allowed myself to make this request. Excuse me.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[OT] Help for a RegEx Fonntuggnio <JoeFonntuggnio@libbbero.it> - 2023-08-02 19:38 +0200
Re: [OT] Help for a RegEx Christian Gollwitzer <auriocus@gmx.de> - 2023-08-02 20:00 +0200
Re: [OT] Help for a RegEx MarioCPPP <NoliMihiFrangereMentulam@libero.it> - 2023-08-03 00:52 +0200
Re: [OT] Help for a RegEx Paavo Helde <eesnimi@osa.pri.ee> - 2023-08-02 21:15 +0300
Re: [OT] Help for a RegEx scott@slp53.sl.home (Scott Lurndal) - 2023-08-02 18:20 +0000
Re: [OT] Help for a RegEx MarioCPPP <NoliMihiFrangereMentulam@libero.it> - 2023-08-03 00:56 +0200
Re: [OT] Help for a RegEx MarioCPPP <NoliMihiFrangereMentulam@libero.it> - 2023-08-03 00:55 +0200
Re: [OT] Help for a RegEx Paavo Helde <eesnimi@osa.pri.ee> - 2023-08-03 11:36 +0300
Re: [OT] Help for a RegEx MarioCPPP <NoliMihiFrangereMentulam@libero.it> - 2023-08-04 02:01 +0200
Re: [OT] Help for a RegEx Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-08-04 01:26 +0100
Re: [OT] Help for a RegEx MarioCPPP <NoliMihiFrangereMentulam@libero.it> - 2023-08-05 02:17 +0200
Re: [OT] Help for a RegEx jak <nospam@please.ty> - 2023-08-14 10:37 +0200
Re: [OT] Help for a RegEx MarioCCCP <NoliMihiFrangereMentulam@libero.it> - 2023-08-15 14:14 +0200
Re: [OT] Help for a RegEx jak <nospam@please.ty> - 2023-08-16 21:24 +0200
Re: [OT] Help for a RegEx MarioCCCP <NoliMihiFrangereMentulam@libero.it> - 2023-08-18 21:05 +0200
Re: [OT] Help for a RegEx jak <nospam@please.ty> - 2023-08-19 09:18 +0200
Re: [OT] Help for a RegEx Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-08-02 11:58 -0700
Re: [OT] Help for a RegEx wij <wyniijj5@gmail.com> - 2023-08-12 23:33 -0700
csiph-web