-
Regular expressions
Hi
Does Java have any features that make it easy to work with regular expressions?
Thanks
Amir
-
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
-
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
-
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
>
>
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks