<div dir="ltr">I beleave regex is not a good choice.<br>If you compare the speed you will find SynEdit is more faster.<br>I import it to make my syntax for my site using PHP i found my Highlighter is more faster (10 time) than the famous one (Geshi) that use the regex.<br>
<br><a href="http://www.parmaja.com/forums/viewtopic.php?id=45">http://www.parmaja.com/forums/viewtopic.php?id=45</a><br><a href="http://qbnz.com/highlighter/">http://qbnz.com/highlighter/</a><br><br><div class="gmail_quote">
On Tue, May 25, 2010 at 4:14 PM, Graeme Geldenhuys <span dir="ltr"><<a href="mailto:graemeg.lists@gmail.com">graemeg.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 25 May 2010 14:38, Marco van de Voort wrote:<br>
><br>
> But the main problem IMHO is that regex is not suited to highlight many<br>
> languages that require correct detection of matching tokens, like the Pascal<br>
> nested comments.<br>
<br>
</div>mcedit (editor part of Midnight Commander) supports 68 different file<br>
formats by default. That alone is already very impressive.<br>
<br>
gEdit supports 85 different file formats by default (included in<br>
Ubuntu 10.04). Even more impressive than mcedit.<br>
<br>
<br>
In both cases, I simply had to tweak one or two lines of the pascal<br>
syntax definition files to get the Object Pascal syntax correct for<br>
Free Pascal specific features I use and for my code. So this is<br>
clearly not so much of a problem and regex is sufficiently flexible<br>
for most (if not all) languages.<br>
<br>
I don't want to make this a debate if regex is a good choice or not. I<br>
am going to use regex no matter what others say, I simply need to find<br>
out more information on how to tie it into a editor component and what<br>
is required from the editor component. I'll download the code for the<br>
gtksourceview component (what is used in gEdit) and see if that gives<br>
me some hints.<br>
<br>
Thinking about it, I should also take a look at Sun's Java code. I<br>
quite like their Document interface and how flexible it is to use...<br>
even for something as simple as a TEdit and to as complex as a<br>
full-blown programming editor or WYSIWYG editor.<br>
<div class="im"><br>
--<br>
Regards,<br>
- Graeme -<br>
<br>
<br>
_______________________________________________<br>
fpGUI - a cross-platform Free Pascal GUI toolkit<br>
<a href="http://opensoft.homeip.net/fpgui/" target="_blank">http://opensoft.homeip.net/fpgui/</a><br>
<br>
--<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Zaher Dirkey<br>
</div>