Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Validation for MAC address using regular expression

622265Mar 25 2009 — edited Mar 25 2009
Oracle Database 10g Express Edition Release 10.2.0.1.0

Please, I need assistance with creating a validation for text field containing MAC address. I would like to have a validation like the built in one for IP address
^[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}$

The Mac address needs to follow the format
00:1a:a0:40:07:a3
00:21:70:aa:17:61

The validation should check:
1. Each segment can contain letters or numbers
2. Only letters a – f can be entered
3. Colons are the only allowed separator
4. Only 6 segments are allowed

If any of those checks fail then the user will just get an error and ask the address to be reinserted. Right now I have each segment separated into different text fields then combine after submission into the table. This works but slows down data entry as users are unable to just copy and paste. Any help setting this up would be appreciated.

Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 22 2009
Added on Mar 25 2009
3 comments
1,586 views