正規表現テスト

by taiga
Source の値の変更を判別して正規表現テストします
♥0 | Line 34 | Modified 2010-10-01 11:54:04 | MIT License
play

ActionScript3 source code

/**
 * Copyright taiga ( http://wonderfl.net/user/taiga )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/Aooj
 */

<?xml version="1.0" encoding="utf-8"?>
<s:Application
    xmlns:fx = "http://ns.adobe.com/mxml/2009"
    xmlns:s  = "library://ns.adobe.com/flex/spark"
    xmlns:mx = "library://ns.adobe.com/flex/mx"
>
    <fx:Style>
        @namespace mx "library://ns.adobe.com/flex/mx";
        global      { font-size   : 30;  }
        mx|FormItem { label-width : 120; }
    </fx:Style>
    <fx:Declarations>
        <mx:RegExpValidator
            property     = "text"
            required     = "true"
            expression   = "{rt.text}"
            flags        = "{ft.text}"
            source       = "{tt}"
            trigger      = "{tt}"
            triggerEvent = "change"
         />
    </fx:Declarations>
    <s:VGroup width="100%" height="100%" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">
        <mx:FormItem label="RegExp" width="100%">
            <s:TextInput id="rt" width="100%" text="^([^\s ].*[^\s ]|[^\s ])$" />
        </mx:FormItem>
        <mx:FormItem label="flags" width="100%">
            <s:TextInput id="ft" width="100%" text="g" />
        </mx:FormItem>
        <mx:FormItem label="source" width="100%">
            <s:TextInput id="tt" width="100%" text="taiga hirohata" />
        </mx:FormItem>
    </s:VGroup>
</s:Application>