Hi
Does Java have any features that make it easy to work with regular expressions?
Thanks
Amir
Printable View
Hi
Does Java have any features that make it easy to work with regular expressions?
Thanks
Amir
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
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
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
>
>
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