Skip to content

Instantly share code, notes, and snippets.

@pwndev
Last active April 1, 2025 07:40
Show Gist options
  • Select an option

  • Save pwndev/6533a01df93013c5109da83fe890402f to your computer and use it in GitHub Desktop.

Select an option

Save pwndev/6533a01df93013c5109da83fe890402f to your computer and use it in GitHub Desktop.
A Rider 'Find & Replace' regex collection

Rider 'Find' Regex Collection

TODO Comments

Search for your todo comments in any ticket:

  • initials|initials_reverse replace this with your initials
\/\/ ?TODO ?(#.*)? ?(initials|initials_reverse):

Search for any todo comments in a specific ticket, e.g. 71782

  • #71782 can be replaced with a specific story id
\/\/ ?TODO ?(#71782)?:

Rider 'Find & Replace' Regex Collection

Transform new DateTime(a, b, c, x, y, z) to DateTime.Parse('YYYY-MM-dd HH:mm:ss')

Changing this requires the following 2, if the date includes a time segment, or 3, if the date did not include one.

Modify definition

Find: new DateTime\(\s*?(\d{4})\s*?,\s*?(\d{1,2})\s*?,\s*?(\d{1,2})\s*?(,\s*?(\d{1,2})\s*?(,\s*?(\d{1,2})\s*?(,\s*?(\d{1,2})\s*?)))?\)

Replace: DateTime.Parse\("$1-$2-$3 $5:$7:$9"\)

Clean up trailing zeroes

Find: (Parse\(\".*)(\-|:|\s)(\d)(\-|:|\s|\")

Replace: $1$2\0$3$4

Clean up leftovers if DateTime did not include time

Find: (\"\d{4}-\d{2}-\d{2}) ::\"

Replace: $1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment