RegEx and Program class in package

Really two questions.
1) Is there a class managing regular expressions, or wild card file matching.

2) is it possible to put application classes, (those with a main() ) in a package and or jar and run them.

Null Term
Who is Participating?
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.

(1) Look at OROMatcher & download it ,

look at this for how to use it. 

Mostly you need to specify the RegEx string and that's it ,the rest doesnt vary that much.

wild card file matching?
what do u mean to say?

NullTerminatorAuthor Commented:
Wild card file matching as in the the accept() method of a fileFilter class.  Using RegEx I could simulate the *.x?? syntax to find 'Excel' related files.

I'll try number 2 again. and post followup

NullTerminatorAuthor Commented:
OK, mbormann,  with the following

// package ptl;
class hello
      public static void main(String args[])      
            System.out.println("Hello World...");                  

I can add to jar and include jar in classpath and execute, but with package uncommented it can't find the class hello.

Any suggestion?  (jar is also named ptl.jar - conflict with package name ? )  tried jar cf and jar cf0 same result
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.


Managing Source and Class Files

Creating and Using Packages

jar-The Java Archive Tool
Usage: jar {ctx}[vfm0M] [jar-file] [manifest-file] files ...
  -c  create new archive
  -t  list table of contents for archive
  -x  extract named (or all) files from archive
  -v  generate verbose output on standard error
  -f  specify archive file name
  -m  include manifest information from specified manifest file
  -0  store only; use no ZIP compression
  -M  Do not create a manifest file for the entries

If any file is a directory then it is processed recursively.
Example: to archive two class files into an archive called classes.jar:
  jar cvf classes.jar Foo.class Bar.class
Note: use the '0' option to create a jar file that can be put in your CLASSPATH
sun JAR tutorial
JAR format
Manifest files can contain arbitrary information about the files in the archive,
such as their encoding or language. If the JAR archive is intended for use with
the SmartUpdate feature of Communicator, the manifest file must include, at a minimum,
the address of the installation file

Using the Jar Manifest

Use a JAR/ZIP/CAB file with an Applet
Support for Multiple CABs or JARs in the Same APPLET Tag
seems like u found the answer to 1)while I was away ,vladi's response is very good for 2).

I will only add
>>>include jar in classpath

have u included c:\abcd\ptl.jar  in classpath or just c:\abcd ?

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
NullTerminatorAuthor Commented:
Yes, I did explicitly include the jar file with jar extension.  Two things seem to affect it.  It seems ( by my reading ) that you may only have one 'main class' or application in a jar, and by my experience that the 'application' can't be in a package.

Thnaks for the help the tip for ORO was a big help.
I will award you the points.

what about some points for me? :)
why do you want points?
you have got enough,or you want to overtake heyhey?
NullTerminatorAuthor Commented:
sorry vladi, I shouldn't have put two topics in one question.  Your response to part two was helpful as well.
Yes I want to overtake heyhey! :)

Best regards
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

From novice to tech pro — start learning today.