Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

A? question? about? regular? expressions?, Take? 2?

Thread view: 
Covington Bradshaw - 17 Dec 2006 21:12 GMT
Hi every one,

    I have a basic regular expressions question.
It goes like this: How do I extract a sequence of
@-delimited characters from a text?

Example: @{1}.*?@{1}
Will give:
123456789abcdefhghij
When applied to the following text:
@123456789abcdefghij@987654321stuvwxyz@

However I am trying to build a regular expression
for the more complex case that will also handle the
escape character for @ which the double @@. Consequently
I need to know how to extract

123456789@@abcdefhghij

from

@123456789@@abcdefghij@987654321@@stuvwxyz@

using regular expressions.

Thanks
Chris Smith - 17 Dec 2006 21:24 GMT
> However I am trying to build a regular expression
> for the more complex case that will also handle the
> escape character for @ which the double @@.

Ah, I think I see what you mean.  How about:

   @([^@]|((@@)*))@

The result will be in group 1.

It would be nice if you'd provided this information in your existing
thread rather than starting a new one.

Signature

Chris Smith



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.