Skip to content

Instantly share code, notes, and snippets.

@mr5z
Last active July 6, 2017 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mr5z/83f33a22e4d39db7970fccdbe68e0ba4 to your computer and use it in GitHub Desktop.
Save mr5z/83f33a22e4d39db7970fccdbe68e0ba4 to your computer and use it in GitHub Desktop.
regex
BindableProperty\.Create
< // begin of template
\s*? // optional spaces
[a-zA-Z0-9\.]+ // matches letters and numbers including dots
, // literal comma
\s*? // optional spaces
([a-zA-Z0-9\.\?<>]+) // matches letters, numbers, dots, greater/less than signs, question marks - first group
> // end of template
\s*? // optional spaces
\( // begin of function invoke i.e open parenthesis
\s*? // optional spaces
[a-zA-Z]+ // matches letters only
\s*? // optional spaces
=> // pre lambda body
\s*? // optional spaces
[a-zA-Z]+ // match any letters
\. // literal dot
([a-zA-Z0-9]*) // matches letters and numbers
, // literal comma
\s*? // optional spaces
( // - begin of second group
([a-zA-Z0-9\.\s\(\"#,\-)])+ // matches letters, numbers, dots, spaces, double quotes, sharps, minus signs
(\.[a-zA-Z]){0,} // matches letters and dots ranging from 0 to any count
) // - end of second group
(,[a-zA-Z\.]){0,} // matches token starting with comma followed by letters including dots from 0 to any count
\) // end of function invoke i.e close parenthesis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment