Reputation: 359
XML file contains <Wildcard>
tag,
<Wildcard>r_prior*.obj</Wildcard>
I want to access file with name r_prior[0-9].obj , there can be a file r_prior_dummy.obj (which I dont need), but with current code it's taking r_ram_dummy.obj also.
Schema code for <Wildcard>
:
<simpleType name="Wildcard">
<restriction base="string">
<pattern value="[^\\/]+"></pattern>
</restriction>
</simpleType>
I tried putting <Wildcard>r_prior[0-9].obj</Wildcard>
, but it does not work.
How should I do this?
Upvotes: 2
Views: 2778
Reputation: 111491
There appear to be two independent types of pattern matching in play here:
xs:pattern
. More expressive than file globbing; uses *
to match zero or more of the
preceding character; ?
to match the preceding character optionally;
and many more matching constructs.*
to match any character; ?
to match exactly one unknown character
(in some cases includes 0 unknown characters); etc.Assuming that you can only change the XML file, you need to check the Java app to see what type of file globbing constructs it supports. (If you have the source, see what call is being made to filter the list of files and check its documentation.) You can assume that *
is supported. You cannot assume that [characters]
is supported, for example.
Upvotes: 1
Reputation: 817
Maybe you need to escape "."
r_prior[0-9][.]obj
See working exemple here : RegexR
Upvotes: 0