Hi all, i have to see if i can parse a form entry (textbox) and depending on the input i would create a backdoor to another section of the application. Let me explain. I have textbox with a title of "Description" where people are required to provide some free form text. But if someone enters a e-mail address in this field it does something special. Now i was only searching for the "@" sign and the "." in the email string and that worked ok BUT this method has a flaw in it.
I need to set this reqular expression in such a way that :
(1) It will check if the "description" field has more that one word string (i.e., "admin@admin.address" NOT "my email is admin@admin.address"). If its the later then treat typed text as description.
(2) when it sees that there is only an email address in the "description" text box, only then would it use the typed in email address.
I know that this reqular expression is not very fancy but i need to somehow prove that this would work both in perl and in java.
Thanks for your help.
2004-05-12 Edit by jdporter: Changed title from 'special handling with reqular expressions'
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.