Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old April 4th, 2002, 01:24 PM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 11
Regular Expressions in java

Alright, guys I haven't used Java in over three years and I need some help. I've been assinged the task of creating a java servlet with upload capabilities. Now I've already searched the site and I see a number of solutions for uploading. My problem is, after I get this file, I need to do a lot of adjustments to it. This would be super easy in perl, but we're trying not to introduce too many technologies to solve the problem. Here are my questions.

1. Does Java have regular expressions? (although the 1000+ page tome I have doesn't mention it, I'd like to know for sure).
2. If Java doesn't have regular expressions, can the perl interpreter be embedded into java so that I can access perl's functionality (I know that this can be done in C).
3. If no. 2 isn't possible, can java kick off a system command (which in this case could be a perl script). Again, the tome I have doesn't mention a java class to handle system commands.

Obviously I'd like choice number one to be available to me because I don't want the overhead of loading the perl script into memory every time. Any help would be greatly appreciated. Thanks in advance.

Reply With Quote
  #2  
Old April 4th, 2002, 01:33 PM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,632 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 12 m 33 sec
Reputation Power: 77
Send a message via AIM to Hero Zzyzzx
google is your friend. Next time start there.

see

http://jakarta.apache.org/regexp/

which was result 5 when I searched for "java regular expressions"

So, no, java doesn't come with regular expressions by default.

Reply With Quote
  #3  
Old April 4th, 2002, 02:44 PM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 11
Thanks for the tip!

Reply With Quote
  #4  
Old April 4th, 2002, 05:15 PM
Fireman-x Fireman-x is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 7 Fireman-x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Isn't regular exp. built into 1.4?

Reply With Quote
  #5  
Old April 5th, 2002, 12:10 PM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 11
Actually, it looks like they do. From what I see, however (and I haven't really looked at it to much, so I'm probably wrong), it looks like the reg ex package created by apache is more extensive. Anyway, the good thing is that there are solutions out there. Thanks, guys.

Reply With Quote
  #6  
Old April 5th, 2002, 12:13 PM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 11
As usual, I'm completely wrong. At least I'm consistent at something. Although the 1.4 syntax is different to the reg ex package created by apache, it looks to be just as robust. I'll say no more about this!

Reply With Quote
  #7  
Old April 5th, 2002, 03:16 PM
Fireman-x Fireman-x is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 7 Fireman-x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm glad you checked this out. I'm going to be building a log parser in Java, and needed a Regex package. I was originally going to use Apache's solution, but since this is built right in and I'm running 1.4, I'll use this instead.

Reply With Quote
  #8  
Old July 31st, 2002, 08:39 AM
kittykiller's Avatar
kittykiller kittykiller is offline
Golden Member =p
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Final Frontier
Posts: 9 kittykiller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i find http://www.cacas.org/java/gnu/regexp a really nice alternative to both the jdk and apache regex packages.

Reply With Quote
  #9  
Old July 31st, 2002, 10:50 PM
jnicholas jnicholas is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 5 jnicholas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Apache ORO

Java 1.4 does add regular expressions. There are actually two jakarta regex packages. regexp like two posters mentioned and also ORO (http://jakarta.apache.org/oro/) ORO is more complete than regexp and I think is more like Perl's pattern matching.

Reply With Quote
  #10  
Old August 2nd, 2002, 01:21 AM
snowdd3000 snowdd3000 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 0 snowdd3000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by Hero Zzyzzx
google is your friend. Next time start there.

see

URL

which was result 5 when I searched for "java regular expressions"

So, no, java doesn't come with regular expressions by default.


good

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Regular Expressions in java


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway