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.

Thanks
Null Term
LVL 3
NullTerminatorAsked:
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.

mbormannCommented:
(1) Look at OROMatcher & download it ,
http://www.quateams.com/oro/software/OROMatcher1.1.html

look at this for how to use it.
http://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=10244033 

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?

(2)Yes
0
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

Thanks
'\0'
0
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
'\0'
0
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.

vladi21Commented:
look:

Managing Source and Class Files
http://java.sun.com/docs/books/tutorial/java/more/managingfiles.html

Creating and Using Packages
http://java.sun.com/docs/books/tutorial/java/more/packages.html

jar-The Java Archive Tool
http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/jar.html
---
C:\jdk\bin>C:\jdk\bin\jar.exe
Usage: jar {ctx}[vfm0M] [jar-file] [manifest-file] files ...
Options:
  -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 http://java.sun.com/docs/books/tutorial/jar/index.html
---
JAR format http://developer.netscape.com/docs/manuals/signedobj/jarfile/jar.htm
http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html 
http://developer.java.sun.com/developer/Books/JAR/basics/manifest.html
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
http://www.gamelan.com/journal/techworkshop/030199_jmani.html

---
Use a JAR/ZIP/CAB file with an Applet
http://codeguru.developer.com/java/articles/547.shtml
Support for Multiple CABs or JARs in the Same APPLET Tag
http://support.microsoft.com/support/kb/articles/Q177/1/59.ASP
0
mbormannCommented:
'\0'
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 ?
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
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.

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

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

From novice to tech pro — start learning today.