procedure TForm1.Button1Click(Sender: TObject); const bigString = 'Look for a the strings in this strang of strungs.'; littlestring = '(str)([iau]ng)'; var regex : TRegEx; i, j : integer; mygrps: TGroupCollection; begin regex := TRegEx.Create(littlestring); mycoll := regex.Matches(bigString); Edit1.Text := 'Count: ' + IntToStr(mycoll.Count); memo1.Lines.Add('First Collection: '); for i := 0 to mycoll.Count-1 do begin memo1.Lines.Add('Match #' + IntToStr(i) + ': ' + mycoll.Item[i].Value); memo1.Lines.Add('Group: ' + IntToStr(i)); mygrps:= mycoll.Item[i].Groups; for j := 0 to mygrps.Count-1 do memo1.Lines.Add('Value: ' + mygrps.Item[j].Value); end; end;
The iframe element + CSS
Was that the “—” technique in action?
And, is the Mac screen snapshot just pasted in?
It looks great!
I was looking to see if we could have something that looked like the 2nd one, but was editable / copyable.
It is from this website: https://carbon.now.sh/
They can export an iframe … maybe with some fiddling that could be turned into something that would play nice with the forum. (?)
Or maybe the highlighting in the forum might be updateable?
Actually, comparing the two, it looks like the tokenising is the same between the two
and it’s only the colouring and font that is different.
What theme/colour combinations are these two?
I have theme Material Design Theme and colour ADUG Material Dark.
This is giving me syntax highlighting, unless it changes when I send the reply.
procedure TForm1.Button1Click(Sender: TObject);
when we share source code I prefer the text option as it can be searched. We do have support for syntax highlighting built-in Discourse.
Perhaps we can get better code themes using something like this - Codeblock Theme Picker - theme - Discourse Meta
I’ll investigate this later today
@SueKing Ah yes. It displays according to the viewer’s settings (makes sense).
I was just poking around to see what the options are.
@Mathias Hi. Yes. The first post has the standard code via ```
It was not especially good looking in the default theme I had, so I was trying to see if something else could give us different colours + copyable text.
An over-complicated option would be pasting in a graphic from the Carbon website, plus the link to the code.
I’m sure the standard will be fine - especially if @vincent gets some time to look into that option he linked.
I added the Codeblock theme picker component - unfortunately it doesn’t allow the user to choose a theme - it’s site wide so we have to chose between light and dark - I vote dark
I’ll keep investigating to see if there are any better options.
Try refreshing your page - I have added a plugin that allows us to choose a theme - unfortunately it doesn’t allow chosing different themes for light and dark.
I have asked over on meta.discourse about this.
Got it. Yes. Looks ok to me.
I’m curious what we get if I attach a PAS and DFM file to my post.
Unit1.pas (533 Bytes)
So I tried both a PAS and a DFM and the DFM was disallowed.
When you upload an attachment to your post there’s a whitelist of allowed file extensions, that obviously the committee has configured since among others it includes *.pas and *.dpr. Excluding *.dfm from that list is probably wise, they can get large if they contain images.
Zip files were among the list of allowed extensions so you could always include DFMs in those.
I have just added dfm and fmx.
I was happy without DFM but I guess people are probably only likely to upload DFMs from demo projects, not their whole main form DFM with 50 embedded images in it.
For completeness here’s my test DFM
Unit1.dfm (498 Bytes)
The dark code box looks better than the light one. Much more readable.