?
Solved

PowerBuilder Regular Expression Bug

Posted on 2006-04-27
2
Medium Priority
?
1,661 Views
Last Modified: 2013-12-26
Trying to fix a bug in an email validation expression that needs to be able to handle:

name.bytof@zz.some-city.ca.us

After the @, it's failing on the '-' after the first '.' -- the hyphen works fine if it's before the first '.' but anytime after the first '.' it fails.

Tried quite a few things including:

match(gettext(),'\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-+.]\w+)*')
match(gettext(),'^[a-zA-Z0-9][a-zA-Z\0-9\-_\.]*[a-zA-Z\0-9\-_]\@\w+([-.]\w+)*\.\w+([-.]\w+)*')
etc.

It's mandatory to test for a '.' existence after the '@'.

Suggestions on what would fix this would be great appreciated!
0
Comment
Question by:ssebring
2 Comments
 

Author Comment

by:ssebring
ID: 16563959
Got it to work with:

match(gettext(),'^[a-zA-Z0-9][a-zA-Z\0-9\-_\.]*[^.]\@[^.][a-zA-Z\0-9\-_\.]+\.[a-zA-Z\0-9\-_\.]*[a-zA-Z\0-9]+$')

Thanks anyways!  (this post can be closed)

0
 

Accepted Solution

by:
EE_AutoDeleter earned 0 total points
ID: 16728687
ssebring,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question