Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Retrieving a file pattern format from an array

Posted on 2005-03-23
4
Medium Priority
?
204 Views
Last Modified: 2010-03-31
Hi Experts, I have an array of strings which stores xml files.

I would like to be able to retrieve files with a certain format.

//Current array data
KB_Java.xml
KB_Template.xml
kb00001.xml
kb00002.xml

I would like to retrieve the following.
kb00001.xml
kb00002.xml

My current method is looping through each file entry within the array, assign it to a string and then i wish to say something like,

If(stringFile(i) == certain pattern) then //matching kb00001/kb00002/kb00003 etc ..
    add unique entry to another uniqueEntries array



Very hard and as of yet my research has found nothing on this :o(

Any ideas?


0
Comment
Question by:dev-ngps7
  • 3
4 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 1000 total points
ID: 13611369
>> If(stringFile == certain pattern)

if (stringFile.matches("kb\\d{5}\\.xml"))
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13611383
Explanation: kb followed by exactly 5 digits followed by .xml
0
 

Author Comment

by:dev-ngps7
ID: 13611578
Just what i was after, cheers zzync :o)
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13611611
Thanks :°)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question