Restrict attibute values using xs:pattern and regular expresions

Hello guys,
I need to check using xsd, that the attribute of a node is something like <name>\flex\<fileName>.flex.plugin

I have made the xsd below where i use the regular expression
[a-z]*\\flex\\[a-z]*.flex\.(plugin)$

But this does not work and i cannot figure out why and how to do it correct.
Any help is highly appreciated.
<xs:element name="myplugin">
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attribute name="url" type="plugin:urlType" use="required"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="urlType">
    	<xs:restriction base="xs:string">
    	 <xs:pattern value="[a-z]*\\flex\\[a-z]*.flex\.(plugin)$"></xs:pattern>
    	</xs:restriction>
    </xs:simpleType>

Open in new window

RongasAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gertone (Geert Bormans)Information ArchitectCommented:
< and > are not in [a-z]
it seems like you need a pattern like this

if this doesn't work, please send some real XML examples
&lt;[a-z]*&gt;\\flex\\&lt;[a-z]*&gt;\.flex\.plugin$

Open in new window

0
RongasAuthor Commented:
I still have problems. Also i am not sure if i got correct the regular expression you gave me. i attach example of what i need/done in the txt attached.

also, if it is easy for you, can you also make regular expression you provide to let me have also '-' character allowed?
cheers.
examples.txt
0
Gertone (Geert Bormans)Information ArchitectCommented:
ah, you don't need the <> after all, it is just your mask of the file path
made your question very confusing by the way

Here is the pattern I would use
    <xs:simpleType name="urlType">
        <xs:restriction base="xs:string">
            <xs:pattern value="[a-zA-Z0-9\-]*\\flex\\([a-zA-Z0-9\-]+\.)+plugin"></xs:pattern>
        </xs:restriction>
    </xs:simpleType>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RongasAuthor Commented:
increasing points due to agreeing that question and way of asking the question deserved more points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.