code:
////////////////////////////////
// Regex with scope qualifiers//
////////////////////////////////
// Required parameters:
//     find:    Regex description of what you would like to target.
//
// Optional parameters:
//     replace:      description of what you would like to replace target with.
//                   Variables are okay for non-literal searches and are done by escaping
//                   the selection number \\1 etc.  Default value is "\\0".
//     literal:      Boolean setting to define whether the find and replace is literal or not.
//                   Default is false.
//     greedy:       Boolean setting to define whether search is greedy or not. Default is true.
//     case:         Boolean defining case sensitivity.  True equals sensitive. Defualt is true.
//     dotall:       Boolean defining whether to use dotall flag in regex (include \n etc. when using dot).
//                   Default is False
//     scope_filter: an array of scope qualifiers for the match.
//                       - Any instance of scope qualifies match: scope.name
//                       - Entire match of scope qualifies match: !scope.name
//                       - Any instance of scope disqualifies match: -scope.name
//                       - Entire match of scope disqualifies match: -!scope.name

//////////////////////////////////////////////////////////////
// Scope search with regex qualifier (also find and replace)//
//////////////////////////////////////////////////////////////
// Required parameters:
//     scope:    scope you would like to target
//
// Optional parameters:
//     find:            regex description that is to be applied to the scope
//                      to qualify.  Also can be used to find and replace
//                      within the found scope.  Default is None.
//     replace:         description of what you would like to replace within the scope.
//                      Default value is "\\0".
//     literal:         Boolean setting to define whether the find and replace is literal or not.
//                      Default is false.
//     greedy_replace:  Boolean setting to define whether regex search is greedy or not. Default is true.
//     greedy_scope:    Boolean setting to define whether scope search is greedy or not. Default is true.
//     case:            Boolean setting to define whether regex search is case sensitive. Default is true.
//     dotall:          Boolean defining whether to use dotall flag in regex (include \n etc. when using dot).
//                      Default is False
//     multi_pass_regex:Boolean setting to define whether there will be multiple sweeps on the scope region
//                      region to find and replace all instances of the regex, when regex cannot be formatted
//                      to find all instances in a greedy fashion.  Default is false.
{
    "replacements": {
        // Example replacements
        "fix_fancyquotes_open": {
            "find": "“",
            "replace": "“<i>",
            "greedy": true,
            "case": false
        },
        "fix_fancyquotes_close": {
            "find": "”",
            "replace": "</i>”",
            "greedy": true,
            "case": false
        }
    },

    // If on_save is true, RegReplace will search through the file patterns listed below right before a file is saved,
    // if the file name matches a file pattern, the sequence will be applied before the file is saved.
    // RegReplace will apply all sequences that apply to a given file in the order they appear below.
    "on_save": false,

    // Highlight visual settings
    "on_save_highlight_scope": "invalid",
    "on_save_highlight_style": "outline",

    // on_save replacements
    "on_save_sequences": [
        // An example on_save event that removes dangling commas from json files
        // - file_regex: an array of regex strings that must match the file for the sequence to be applied
        // - case: regex case sensitivity (true|false) false is default (this setting is optional)
        // - file_pattern: an array of file patterns that must match for the sequence to be applied
        // - sequence: an array of replacement definitions to be applied on saving the file
        // - multi_pass: perform multiple passes on file to catch all regex instances
        // - action: (mark|fold|unfold) instead of replace.  Only one action can be used
        {
            "file_regex": [".*\\.sublime-(settings|commands|menu|keymap|mousemap|theme|build|project|completions|commands)"],
            "file_pattern": ["*.json"],
            "sequence": ["remove_json_dangling_commas"]
        },
        // An example on_save_sequence that targets all files and trims trailing spaces
        // - file_pattern: an array of file patterns that must match for the sequence to be applied
        // - sequence: an array of replacement definitions to be applied on saving the file
        {"file_pattern": ["*"], "sequence": ["remove_trailing_spaces"]}
    ],

    // Show replace results in panel
    "results_in_panel": false,

    // Maximum sweep threshold for multi-pass
    "multi_pass_max_sweeps": 100,

    // Color? (scope)
    "find_highlight_color": "invalid",

    // Highlight style? (outline|solid|underline)
    "find_highlight_style": "outline",

    // Search under selection(s) if and only if exists
    "selection_only": true
}


code:
package coc.test {
	import flash.display.MovieClip;
	import coc.model.GameModel;
	import coc.view.MainView;
	import classes.DefaultDict;

	public class TestMainView extends MovieClip {
		public var mainView :MainView;
		public var gameModel :GameModel;

		public function TestMainView() :void {
			// This variable is used to maintain a reference to the Test's
			// this in unbound functions.
			var testThis :TestMainView = this;

			this.gameModel = new GameModel();
			this.mainView = new MainView( this.gameModel );
			this.stage.addChild( this.mainView );

			this.gameModel.flags = new DefaultDict();

			trace( "MainView:", this.mainView );

			this.gameModel.flags[kFLAGS. 273 ] = 0;
			this.mainView.selectSprite( 2 );

			// TODO: put in actual callbacks here because that be how we do, now.
			this.mainView.setButton( 0, 'Lol' );
			this.mainView.setButton( 4, 'Poop' );
			this.mainView.setButton( 6, 'Penis' );
			this.mainView.setButton( 9, 'Clear Buttons' );
			this.mainView.setButton( 8, '' );

			trace( "test: hasButton( 'Lol' )?\n\t",
				this.mainView.hasButton( 'Lol' ), "(Should be 'true')" );

			trace( "test: indexOfButtonWithLabel( 'Poop' )?\n\t",
				this.mainView.indexOfButtonWithLabel( 'Poop' ), "(Should be '4')" );

			trace( "test: getButtonText( 6 ) =>\n\t",
				this.mainView.getButtonText( 6 ), "(Should be 'Penis')" );

			trace( "test: buttonTextIsOneOf( 6, [ 'Peepee', 'Dingaling', 'Penis', 'Cock', 'Doodle', 'Dick', 'Sausage' ] )\n\t",
				this.mainView.buttonTextIsOneOf( 6, [ 'Peepee', 'Dingaling', 'Penis', 'Cock', 'Doodle', 'Dick', 'Sausage' ] ),
				"(Should be 'true')" );

			trace( "test: buttonIsVisible( 0 ) =>\n\t",
				this.mainView.buttonIsVisible( 0 ),
				"(Should be 'true')" );

			trace( "test: buttonIsVisible( 8 ) =>\n\t",
				this.mainView.buttonIsVisible( 8 ),
				"(Should be 'false')" );

			trace( "test: menuButtonHasLabel( 'newGame', 'New Game' )?\n\t",
				this.mainView.menuButtonHasLabel( 'newGame', 'New Game' ),
				"(Should be 'true')" );

			function makeButtonTracer( name :String ) :Function {
				return function( event ) {
					trace( "You pressed the", name, "button!" );
				};
			}

			this.mainView.onNewGameClick = makeButtonTracer( "NewGame" );
			this.mainView.onDataClick = makeButtonTracer( "Data" );
			this.mainView.onStatsClick = makeButtonTracer( "Stats" );
			this.mainView.onLevelClick = makeButtonTracer( "Level" );
			this.mainView.onPerksClick = makeButtonTracer( "Perks" );
			this.mainView.onAppearanceClick = makeButtonTracer( "Appearance" );

			this.mainView.setButton( 2, 'Hide Menu' );
			this.mainView.setButton( 3, 'Show Menu' );
		};
	}
}

license: unknown