use strict;
my $str = '
public static BindableProperty FontStyleProperty =
BindableProperty.Create<Button, FontStyle>(p => p.FontStyle, FontStyle.Regular);
public static BindableProperty DisabledTextColorProperty =
BindableProperty.Create<Button, Color>(p => p.DisabledTextColor, Color.Default);
public static BindableProperty DisabledBackgroundColorProperty =
BindableProperty.Create<Button, Color>(p => p.DisabledBackgroundColor, Color.Default);
public static BindableProperty CornerRadiusProperty =
BindableProperty.Create<Button, Thickness>(p => p.CornerRadius, 0);
public static BindableProperty ImageHeightProperty =
BindableProperty.Create<Button, double>(p => p.ImageHeight, new PointSize(20));
public static BindableProperty BackgroundImageProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.BackgroundImage, null);
public static BindableProperty HighlightedBackgroundImageProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.HighlightedBackgroundImage, null);
public static BindableProperty BackgroundImagePatternProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.BackgroundImagePattern, null);
public static BindableProperty HighlightedBackgroundImagePatternProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.HighlightedBackgroundImagePattern, null);
public static BindableProperty ImageLeftProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.ImageLeft, null);
public static BindableProperty SelectedImageLeftProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.SelectedImageLeft, null);
public static BindableProperty ImageTopProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.ImageTop, null);
public static BindableProperty ImageRightProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.ImageRight, null);
public static BindableProperty ImageBottomProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.ImageBottom, null);
public static BindableProperty SelectedImageRightProperty =
BindableProperty.Create<Button, FileImageSource>(p => p.SelectedImageRight, null);
public static BindableProperty PaddingProperty =
BindableProperty.Create<Button, Thickness>(p => p.Padding, 0);//DefaultPadding);
public static BindableProperty TextPaddingProperty =
BindableProperty.Create<Button, Thickness>(p => p.TextPadding, DefaultTextPadding);
public static BindableProperty ImageRightHeightProperty =
BindableProperty.Create<Button, double>(p => p.ImageRightHeight, Double.NaN);
public static BindableProperty ImageRightWidthProperty =
BindableProperty.Create<Button, double>(p => p.ImageRightWidth, Double.NaN);
public static BindableProperty ImageLeftHeightProperty =
BindableProperty.Create<Button, double>(p => p.ImageLeftHeight, Double.NaN);
public static BindableProperty ImageLeftWidthProperty =
BindableProperty.Create<Button, double>(p => p.ImageLeftWidth, Double.NaN);
public static BindableProperty TiltEnabledProperty =
BindableProperty.Create<Button, bool>(p => p.TiltEnabled, false);
public static BindableProperty CenterImageProperty =
BindableProperty.Create<Button, bool>(p => p.CenterImage, false);
public static BindableProperty RefitTextEnabledProperty =
BindableProperty.Create<Button, bool>(p => p.RefitTextEnabled, false);
public static BindableProperty MinimumFontSizeProperty =
BindableProperty.Create<Button, double>(p => p.MinimumFontSize, new PointSize(8));
public static BindableProperty TextLineBreakModeProperty =
BindableProperty.Create<Button, LineBreakMode>(p => p.TextLineBreakMode, LineBreakMode.MiddleTruncation);
public static BindableProperty XAlignProperty =
BindableProperty.Create<Button, Xamarin.Forms.TextAlignment>(p => p.XAlign, Xamarin.Forms.TextAlignment.Center);
public static BindableProperty YAlignProperty =
BindableProperty.Create<Button, Xamarin.Forms.TextAlignment>(p => p.YAlign, Xamarin.Forms.TextAlignment.Center);
public static BindableProperty BorderlessProperty =
BindableProperty.Create<Button, bool>(p => p.Borderless, false);';
my $regex = qr/BindableProperty\.Create<[a-zA-Z]+,\s*?([a-zA-Z]+)>\s*?\(\s*?[a-zA-Z]+\s*=\>\s*?[a-zA-Z]+\.([a-zA-Z]*),\s*?([a-zA-Z0-9\s\(\)]+(\.[a-zA-Z]){0,})\)/p;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html