UltraEdit正则表达式:
功能:
<xs:element name="AddressInfo" type="xs:string" fixed="255" />
<xs:element name="AddressInfo" type="xs:string" fixed="" />
<xs:element name="AddressInfo" type="xs:string" fixed="255" nillable="0" />
<xs:element name="AddressInfo" type="xs:string" fixed="" nillable="0" />

替换成:
        <xs:element name="AddressInfo" >
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="255" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>

         <xs:element name="AddressInfo" >
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>

        <xs:element name="AddressInfo" nillable="0"  >
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="255" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>

        <xs:element name="AddressInfo" nillable="0" >
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="" />
                </xs:restriction>
            </xs:simpleType>
        </xs:element>

使用的查找替换语句如下:

Find RegExp "^(<xs:element name=^)^("[a-z0-9A_Z_]+"^)^( type="xs:string" fixed=^)^("[0-9]+"^)^( ^)^(/^)^(>^p^)"
Replace All "^1^2^5^7            <xs:simpleType>^p                <xs:restriction base="xs:string">^p                    <xs:maxLength value=^4 />^p                </xs:restriction>^p            </xs:simpleType>^p        </xs:element>^p"

Find RegExp "^(<xs:element name=^)^("[a-z0-9A_Z_]+"^)^( type="xs:string" fixed=^)^(""^)^( ^)^(/^)^(>^p^)"
Replace All "^1^2^5^7            <xs:simpleType>^p                <xs:restriction base="xs:string">^p                    <xs:maxLength value=^4 />^p                </xs:restriction>^p            </xs:simpleType>^p        </xs:element>^p"

Find RegExp "^(<xs:element name=^)^("[a-z0-9A_Z_]+"^)^( type="xs:string" fixed=^)^("[0-9]+"^)^( nillable="0" ^)^(/^)^(>^p^)"
Replace All "^1^2^5^7            <xs:simpleType>^p                <xs:restriction base="xs:string">^p                    <xs:maxLength value=^4 />^p                </xs:restriction>^p            </xs:simpleType>^p        </xs:element>^p"

Find RegExp "^(<xs:element name=^)^("[a-z0-9A_Z_]+"^)^( type="xs:string" fixed=^)^(""^)^( nillable="0" ^)^(/^)^(>^p^)"
Replace All "^1^2^5^7            <xs:simpleType>^p                <xs:restriction base="xs:string">^p                    <xs:maxLength value=^4 />^p                </xs:restriction>^p            </xs:simpleType>^p        </xs:element>^p"


--说明:
--其中查找使用4中方式, 替换都相同(:
--因为我不知道或如何使用(: 所以采用了4个查找语句(:

posted on 2007-06-22 17:48  袁礼定  阅读(1348)  评论(0编辑  收藏  举报