-
Convert String to Regular Expression
Hi, anyone knows if there is a way to convert an input string into a Regular Expression??
As a example, if I input the string: "email@mail.com" the output string should be like: "[A-Za-z]+@[A-Za-z]+\\.com"
Thanks in advance!!
-
In the most general sense, I would think that this problem is impossible. There are a lot of different regular expressions that match "email@mail.com":
"[A-Za-z]+@[A-Za-z]+\\.com"
"email@mail\\.com"
"*.@mail\\.com"
...
So, you are probably going to need more information than just a single String, but even with multiple strings, what if you get two strings, I still don't think you have enough information.
~evlich
Similar Threads
-
By mdengler in forum ASP.NET
Replies: 0
Last Post: 11-26-2002, 02:32 PM
-
By Fred Mayes in forum Java
Replies: 1
Last Post: 06-05-2001, 06:12 AM
-
By chandra in forum VB Classic
Replies: 0
Last Post: 06-22-2000, 07:36 AM
-
By Chandra in forum VB Classic
Replies: 0
Last Post: 06-22-2000, 07:30 AM
-
By Robert Rieth in forum VB Classic
Replies: 1
Last Post: 04-11-2000, 03:21 AM
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