I want to use Regular Expressions to extract information from my source code. Can you help me to build a RegEx that retrieves the units used on the source code ?.
Source code sample:
unit ComandesVendes;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Manteniment;
type
TFComandesVendes = class(TFManteniment,ActualitzacioFinestra)
QRCapsaleraNumero: TIntegerField;
QRCapsaleraData: TDateTimeField;
QRCapsaleraDataEntrega: TDateTimeField;
...
...
I need to get the comma-separated file names since the uses
clause up to the next ;
. In that sample the output must be:
Windows
Messages
SysUtils
Variants
Classes
Graphics
Controls
Forms
Dialogs
Manteniment
I'm trying something like
^ *uses(\n* *(\w*),)* *\n* *(\w*) *;
It matches the uses clause, but it doesn't return each file name separately.
Thank you.