• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regular Expressions

 
Gustavo Adolpho Bonesso
Ranch Hand
Posts: 103
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !

Somebody knows good sites about Regular Expressions ?

Thank�s !
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reference Website
Java Regular Expression From Sun

Regular Expression in Java
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition, you may consider Max's RE book:
Java Regular Expressions: Taming the java.util.regex Engine.

Max is one of the moderators, and he also wrote a very good book for SCJD with J2SE 1.4.

Nick
 
Jose D. Montero
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have preppared the following list of Web Refeences. For other information and examples, you may contact me at JoseDMontero@Yahoo.com

Regular Expressions � References
List prepared by Jose D. Montero (joseDMontero@yahoo.com)

Web References

Tutorial
� RegexBuddy's RegEx Tutorial
http://www.regular-expressions.info/tutorial.html
� An excellent tutorial and overview of regular expressions is Mastering Regular Expressions, 2nd Edition, Jeffrey E. F. Friedl, O'Reilly and Associates, 2002. Chapter 8: Java is available from O'Reilly.
RegEx in .Net
� RegEx in .Net
http://www.regular-expressions.info/dotnet.html
� The Regulator
The Regulator is an advanced, free regular expressions testing and learning tool. (C#, Visual Basic)
http://royo.is-a-geek.com/iserializable/regulator/
http://regulator.sourceforge.net/

RegEx in Java
� General information
http://www.regular-expressions.info/java.html
� Tutorial on regular expressions on Java 1.4
http://java.sun.com/docs/books/tutorial/extra/regex/index.html
� Sun Java Docs on RegEx
http://java.sun.com/j2se/1.4/docs/api/java/util/regex/package-summary.html

RegEx in JavaScript
http://developer.netscape.com/docs/manuals/js/core/jsref/regexp.htm
http://devedge.netscape.com/central/javascript/
http://www.regular-expressions.info/javascript.html

RegEx and XML

� Regular Expressions and XML
http://www.xfront.org/xml-schema/

� Tutorial on XML and RegEx
http://www.w3.org/TR/xmlschema-0/ - regexAppendix
Part of XML Schema Part 0: Primer

� XRE
http://www.utilities.cornell.edu/XML/XRE.html

Books
� �Mastering Regular Expressions� by Jeffrey E. F. Friedl,
Mastering Regular Expressions, 2nd Edition, Jeffrey E. F. Friedl, O'Reilly and Associates, 2002. Chapter 8: Java is available from O'Reilly.

RegEx Library
� RegEx Lib
http://www.regexplib.com/
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jose, thanks for the comprehensive list! I archived it at http://faq.javaranch.com/view?ResourcesOnRegularExpressions - don't hesitate to correct or add things...
 
Tong Chen
Ranch Hand
Posts: 1011
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And here is another good one:
http://www.regexlib.com/
 
Alan Moore
Ranch Hand
Posts: 262
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tutorial and reference at http://www.regular-expressions.info/ (mentioned above) is by far the best online resource I've seen. You want to be careful, though, because the tutorial is language-neutral, and not all of the features mentioned in it are available in all languages. So you'll get all excited about conditionals, for instance, only to learn that Java doesn't have them. But that's what the language-specific reference sections are there for.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gustavo Adolpho Bonesso:
Hi !

Somebody knows good sites about Regular Expressions ?

Thank�s !


Just curious... Why are you going to learn about RE? For Computer Science courses like Theory Of Computation or Complier Construction? Or do you just want to apply it in your work?

As for me, I learned it in the past, mainly because of my master course named "Principles of Theory of Computation and Languages"...
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RE is quite useful for searching in text documents, like Text Mining and Web Mining. I have worked with a small project in this area before.

Nick
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicholas Cheung:
RE is quite useful for searching in text documents, like Text Mining and Web Mining. I have worked with a small project in this area before.

Nick


Yes, me too,

And more
Use for check pattern of each data.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does Tiger add new features to RE?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems to me that Java RE aims to take the advantages of pattern matching in PERL, to make pattern comparsion and discovery be more easier.

Nick
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use RE in Tiger ::

1. Scanner
The java.util.Scanner class can be used to convert text into primitives or Strings. Since it is based on the java.util.regex package, it also offers a way to conduct regular expression based searches on streams, file data, strings, or implementors of the Readable interface.

Reference Website
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
 
Alan Moore
Ranch Hand
Posts: 262
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
Does Tiger add new features to RE?


Yes, the Matcher class now has several new methods that make it easier to use for scanning or lexing applications (most of them, of course, are used in the Scanner class, mentioned above).
  • usePattern(Pattern) lets you use a different pattern for subsequent searches, without resetting the matcher's state.
  • region(int, int) lets you limit searches to a sub-range of the matcher's input. This has two related methods:
  • useAnchoringBounds(boolean) - if passed true, the start and end anchors (^ and $) will always match at the region's bounds.
  • useTransparentBounds(boolean) - if passed true, lookarounds and word-boundaries will be able to look past the region's bounds to determine whether they should match.
  • hitEnd() and requireEnd() are useful for working with streams; they let you know if reading in more data would change the result of the last match attempt.

  • There's also the static quote(String) method in Pattern that escapes all regex metacharacters in the string, allowing it to be matched as literal text. Matcher has a similar method, quoteReplacement(String), that escapes the '\' and '$' characters, for when the replacement string comes from an external source.

    All in all, this release raises the regex package to whole new level of usefulness.
    [ August 25, 2004: Message edited by: Alan Moore ]
     
    Ko Ko Naing
    Ranch Hand
    Posts: 3178
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Nicholas Cheung:
    RE is quite useful for searching in text documents, like Text Mining and Web Mining. I have worked with a small project in this area before.

    Nick


    I also have to apply this knowledge in my master course "Advance Algorithms" in this semester... If I am not wrong, I will have to learn it in the next two weeks.... The topic is titled as String Matching...

    Algorithms-related subjects are tough for those, who are in CS, at least for me....
     
    Nicholas Cheung
    Ranch Hand
    Posts: 4982
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    String matching seems appeared in CS field for a long time.

    When I was studying the course Bioinformatics, the lecturer taught us using String matching algorithm to test the similarity of 2 DNAs.

    Although it was quite interesting, to me, it was the beginner of the nightmare!!!

    Nick
     
    Ko Ko Naing
    Ranch Hand
    Posts: 3178
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Nicholas Cheung:
    When I was studying the course Bioinformatics, the lecturer taught us using String matching algorithm to test the similarity of 2 DNAs.

    Although it was quite interesting, to me, it was the beginner of the nightmare!!!


    The course seems interesting to me as well... Is that course similar to the course like Neural Networks, Genetic Algorithm and stuff like that?

    I also have to do a term project related to genetic algorithm in that "Advance Algorithm" course... The deadline is in September...
     
    Nicholas Cheung
    Ranch Hand
    Posts: 4982
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    It was not interesting anyway.

    It focus on scoring scheme that used to define the *similarity* of 2 strings (DNAs), and try to find out the optimal score.

    It was the toughest course I have ever taken.

    Nick
     
    Ko Ko Naing
    Ranch Hand
    Posts: 3178
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Nicholas Cheung:
    It was the toughest course I have ever taken.


    But u made it with flying colours, didn't u?

    I'm trying so hard to pass the master course "Advance Algorithm" with flying colours as well... I'm not sure if I can do that...
     
    Gustavo Adolpho Bonesso
    Ranch Hand
    Posts: 103
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Ko Ko Naing,

    I�m using RE to recognize filenames that fit in specific pattern in large directories. My application must decode these specific files...
     
    Ko Ko Naing
    Ranch Hand
    Posts: 3178
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Gustavo Adolpho Bonesso:
    Ko Ko Naing,

    I�m using RE to recognize filenames that fit in specific pattern in large directories. My application must decode these specific files...


    If your filenames are simple to match and the patterns are stabe, you might not even need to use regex... String's normal methods such as startsWith(), endsWith(), indexOf(), lastIndexOf() and so on might be enough for your case... but I am not quite sure about the requirement of your application much...

    So for core regex, you might want to have a look at the links provided by somkiat above..
     
    Nicholas Cheung
    Ranch Hand
    Posts: 4982
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    I'm trying so hard to pass the master course "Advance Algorithm" with flying colours as well... I'm not sure if I can do that...

    I passed it with flying dark.

    Nick
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic