|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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. |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
||||
|
||||
|
Thanks for the tip!
|
|
#4
|
|||
|
|||
|
Isn't regular exp. built into 1.4?
|
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
||||
|
||||
|
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!
|
|
#7
|
|||
|
|||
|
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.
|
|
#8
|
||||
|
||||
|
i find http://www.cacas.org/java/gnu/regexp a really nice alternative to both the jdk and apache regex packages.
|
|
#9
|
|||
|
|||
|
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.
|
|
#10
|
|||
|
|||
|
Quote:
good |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Regular Expressions in java |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|