Programming Serendipity

プログラミングを中心に種々雑多に書き留めます

memo

memo

formatter
indexer
\.get_(Item|ItemOf|Chars)\((.+?)\)
[$2]

getter
\.get_(.+?)\(\)
.$1

setter
\.set_(Item|ItemOf|Chars)\((.+?),(.+)\);
[$2] = $3;

\.set_(.+?)\((.+)\)
.$1 = $2

compress get-set
^([ \t]+p.+)\r\n[ \t]*\{\r?\n[ \t]*(.*get)\r?\n[ \t]*\{\r?\n[ \t]*(.+;)\r?\n[ \t]*\}\r?\n[ \t]*(.*set)\r?\n[ \t]*\{\r?\n[ \t]*(.+;)\r?\n[ \t]*\}\r?\n[ \t]*\}\r?\n

$1 { $2 { $3 } $4 { $5 } }

compress get or set only
^([ \t]+p.+)\r\n[ \t]*\{\r?\n[ \t]*(.*[gs]et)\r?\n[ \t]*\{\r?\n[ \t]*(.+;)\r?\n[ \t]*\}\r?\n[ \t]*\}\r?\n

$1 { $2 { $3 } }

compress auto-implement get-set
(^[ \t]*p.+? [^\r]+)\r?\n[ \t]*{\r?\n[ \t]*(.*get;)\r?\n[ \t]*(.*set;)\r?\n[ \t]*}\r?\n

$1 { $2 $3 }

compress serializefield
\[SerializeField\]\r?\n[ \t]*private (.+);\r?\n

[SerializeField] $1;

remove coroutine
^(.*)return.*c__Iterator.*$

$1yield return null;

^.*c__Iterator.*\r?\n
^.*DebuggerHidden.*\r?\n
[ \t]*\[HideInInspector\]\r?\n

compress add-remove
(^[ \t]*)(public event)([^\r]+)\r?\n[ \t]*{\r?\n.+\r?\n[ \t]*add\r?\n[ \t]*{\r?\n[ \t]*(.+?) = .+?value.+\r?\n[ \t]*}\r?\n.+\r?\n[ \t]*remove\r?\n[ \t]*{\r?\n[ \t]*(.+?) = .+?value.+\r?\n[ \t]*}\r?\n[ \t]*}\r?\n\r?\n

$1public$3;\r\n

compress blank line
(^[ \t]*(public|private|protected|internal) )(.+?) (.+);\r?\n\r?\n

$1$3 $4;\r\n

compress singleton
Singleton<(.+?)>\.
$1.

var
(^[ \t]+)([a-zA-Z_0-9]+) ([^ ]+? = new \2)
$1var $3

Object/Random
using UnityEngine;
using UnityEngine;\r\nusing Random = UnityEngine.Random;\r\nusing Object = UnityEngine.Object;

Diagnostics
using System.Diagnostics;\r?\n

(none)

out
(Try(GetValue|Parse)\(.+?)ref
$1out


non-regex
this.
base.
Object. ==> GameObject.
func, linq, dictionary

Common
    singleton
    manager controller main
    audio sound bgm se voice player music
    effect particle
    prefab
    title
    debug logger
    animator animation
    extension
    fade transition screen
    input touch
    util utils utility
    save 
    shader
    crypt
    constant const define 
    font
    temp
    pref
    local
    base
    ai