Regular expressions


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Regular expressions

Hybrid View

  1. #1
    Bikhod Guest

    Regular expressions


    Hi

    Does Java have any features that make it easy to work with regular expressions?

    Thanks
    Amir

  2. #2
    john Guest

    Re: Regular expressions

    What is a regular expression?


    "Bikhod" <bikhod@yahoo.co.uk> wrote in message
    news:3ba20acd$1@news.devx.com...
    >
    > Hi
    >
    > Does Java have any features that make it easy to work with regular

    expressions?
    >
    > Thanks
    > Amir




  3. #3
    Paul Clapham Guest

    Re: Regular expressions

    Your question is unclear. Yes, Java has methods for string manipulation,
    which is basically what you need to work with regular expressions. That
    wasn't the answer to your real question, though, was it?

    PC2

    "Bikhod" <bikhod@yahoo.co.uk> wrote in message
    news:3ba20acd$1@news.devx.com...
    >
    > Hi
    >
    > Does Java have any features that make it easy to work with regular

    expressions?
    >
    > Thanks
    > Amir




  4. #4
    Bikhod Guest

    Re: Regular expressions


    A regular expression is a pattern of text that consists of ordinary characters
    (for example, letters a through z) and special characters, known as metacharacters.
    The pattern describes one or more strings to match when searching a body
    of text. The regular expression serves as a template for matching a character
    pattern to the string being searched.

    E.g.

    /\d{2}-\d{5}/ :- Validates an ID number consisting of 2 digits, a hyphen,
    and another 5 digits.

    With regular expressions, you can:

    * Test for a pattern within a string. For example, you can test an input
    string to see if a telephone number pattern or a credit card number pattern
    occurs within the string. This is called data validation.

    * Replace text. You can use a regular expression to identify specific text
    in a document and either remove it completely or replace it with other text.


    * Extract a substring from a string based upon a pattern match. You can find
    specific text within a document or input field

    Bikhod


    "john" <johnny> wrote:
    >What is a regular expression?
    >
    >
    >"Bikhod" <bikhod@yahoo.co.uk> wrote in message
    >news:3ba20acd$1@news.devx.com...
    >>
    >> Hi
    >>
    >> Does Java have any features that make it easy to work with regular

    >expressions?
    >>
    >> Thanks
    >> Amir

    >
    >



  5. #5
    Jeremy Guest

    Re: Regular expressions


    Java does not have cool stuff like Perl has to work with regular expressions.
    You can write your string parsers though with the string manipulation tools
    available in Java.

    Jeremy

    "Bikhod" <bikhod@yahoo.co.uk> wrote:
    >
    >Hi
    >
    >Does Java have any features that make it easy to work with regular expressions?
    >
    >Thanks
    >Amir



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center