CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Pattern Matcher

  1. #1
    Join Date
    Aug 1999
    Posts
    7

    Pattern Matcher

    Hi,

    I am just trying to find a pattern matching api . Can u tell me which
    one can I use.

    I have a
    String str = "Good";
    String test = "G*";

    I want to know whether 'str' is of the pattern 'test' (in this case true).

    Thanx in advance.

    If a reply could also be copied to [email protected] , I'd really
    appreciate it.

    With Regards,
    Lachu
    [email protected]





  2. #2
    Guest

    Re: Pattern Matcher

    hai,
    As far as i know, there is no pattern matching api as such. Instead of opting for a readymade api, u could make the best use of methods in String/StringBuffer classes.

    Methods that would be very important to achieve your goal would be startsWith(), endsWith(), regionMatches() etc. Java's string handling capabilities are so good that U could accomplish your objective with very few lines of code. U could refer to documentation of Sun for the exact signatures of these methods.

    thanx,
    devi prasad
    [email protected]


  3. #3
    Join Date
    Aug 1999
    Posts
    1

    Re: Pattern Matcher

    There are several free regular expressions packages in Java that will do what you require - for example
    http://www.oroinc.com/

    Raj


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured