Regular Expressions 101

Save & Manage Regex

  • Current Version: 3
  • Save & Share
  • Community Library

Flavor

  • PCRE2 (PHP)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java
  • .NET 7.0 (C#)
  • Rust
  • PCRE (Legacy)
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests
Sponsors
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression
Processing...

Test String

Code Generator

Generated Code

$re = '/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,})\)/'; $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);'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result var_dump($matches);

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 PHP, please visit: http://php.net/manual/en/ref.pcre.php