Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/07/22 in all areas

  1. Lars Fosdal

    The Delphi 11.2 release thread

    Just to capture the gossip 🙂
  2. Dave Nottage

    The Delphi 11.2 release thread

    {$IF Declared(RTLVersion111)} {$IF Declared(RTLVersion112)}
  3. Vincent Parrett

    The Delphi 11.2 release thread

    Not sure you can.. the best option would be to change SetAdditionalPCREOptions to AddRawOptions - then it will compile in all supported versions.
  4. Anders Melander

    The Delphi 11.2 release thread

    Remember back in the day when a new release made you go Wooo Hooo ? This release? Meh
  5. Available for subscribers from https://my.embarcadero.com/#downloadsPage What's new: https://www.embarcadero.com/products/rad-studio/whats-new-in-11-alexandria Change log: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/11_Alexandria_-_Release_2 Installed and upgraded smoothly in my test VM Well, except the GetIt plugins... so those needs to be manually reinstalled from the GetIt dialog.
  6. Der schöne Günther

    Get call count with Delphi debugger

    I just noticed that if the breakpoint has a condition, the pass count reflects the number of times the condition was true. That's actually pretty nice. Now if only one line could have multiple breakpoints with different conditions... 😇 PS: Fun fact: If you kill the process with [Ctrl]+[F2] rather than letting it terminate gracefully, the IDE will still show the last pass count for a breakpoint.
  7. PCRE, the regular expression engine used in Delphi has a large number of compile time options only few of which are exposed in the high-level (System.RegularExpressions) or the low-lever (System.RegularExpressionsCore) Delphi interface. For example a useful PCRE option that is not exposed is the PCRE_UCP, which controls the meaning of \w \d etc. When this options is set for example \w matches any Unicode letter or _ character. If it is not set (in Delphi usage) it only matches ascii letter characters. Class helpers can come to the rescue again. uses System.RegularExpressionsAPI, System.RegularExpressionsCore, System.RegularExpressions; type { TPerlRegExHelper } TPerlRegExHelper = class helper for TPerlRegEx procedure SetAdditionalPCREOptions(PCREOptions : Integer); end; procedure TPerlRegExHelper.SetAdditionalPCREOptions(PCREOptions: Integer); begin with Self do FPCREOptions := FPCREOptions or PCREOptions; end; type { TRegExHelper } TRegExHelper = record helper for TRegEx public procedure Study; procedure SetAdditionalPCREOptions(PCREOptions : Integer); end; procedure TRegExHelper.Study; begin with Self do FRegEx.Study; end; procedure TRegExHelper.SetAdditionalPCREOptions(PCREOptions: Integer); begin with Self do FRegEx.SetAdditionalPCREOptions(PCREOptions); end; Example usage: Var RE : TRegEx; Match : TMatch; begin RE.Create('\w+'); RE.SetAdditionalPCREOptions(PCRE_UCP); // No match without this Match := RE.Match('汉堡包/漢堡包'); if Match.Success then ShowMessage(Match.Groups[0].Value);
×