Advice You
#1 in Business Subscribe Email Print

You are here: Home > Internet and Businesses Online > Web Development > Form Checking - Verifying Name Using PHP Ereg

Tags

  • backslash
  • advantages
  • magic quotes
  • companies involved
  • magic quotes

  • Links

  • 3 Common Pitfalls Self-Publishers Make
  • Unsecured Consolidation Loans
  • Tennessee Refinance Loans - Refinance Mistakes That Will Cost You Money
  • Advice You - Form Checking - Verifying Name Using PHP Ereg

    One important use of Regular Expressions (Regex) is to verify fields submitted via a form. In this article, we attempt to write an expression that is ab
    According to USFDA, a combination product is one composed of any combination of a drug and device; biological product and device; drug and biological product
    le to verify the user's first name, middle name, last name or just names in general.

    The expression should allow names such as "Mary", "Mr. James Smith
    ; or drug, device, and biological product and fixed dose combination would include two or more combinations of drug.

    Examples of combination products may in
    " and "Mrs O'Shea" for example. So the challenge here is to allow spaces, periods and single quotation marks in the name field and reject any other char
    lude drug-coated devices, drugs packaged with delivery devices in medical kits, and drugs and devices packaged separately but intended to be used together.

    acters.

    Elimination Technique

    We try to identify and detect all illegal characters in the name field. I came up with the following list:

    Punct
    here is enormous increase in the number of combination products entering the market in the recent years. Combination products have proven advantages but fixe
    ations: ~`!@#$%^&*()=+{}|:;<>"/?,

    Numerics: 0-9

    Noticed that I left out the empty space ( ), period (.) and single quotation mark (') because we are a
    d dose combinations are still in the process of convincing regulatory authority on their advantages over the single ingredient formulations.

    Combination pro
    llowing these 3 characters to pass the verification. In other words, the verification will fail if the name field contains any of the punctuations or nu
    ucts have become life saving products for the pharmaceutical companies who doesn’t have many innovative molecules in their product pipeline and have been inc
    merics above.

    The Regex

    Now, the hardcore part. The regex pattern I came up with is as follows:

    ([[:digit:]]|[~`!@#$%^&*()_=+{}|:;<>"/?,]|[|]|
    easingly used in the product life cycle management. Even the companies having product patents are trying to extend their product life cycle through the combi
    )+

    Let me briefly explain what this pattern means. The expression can be represented by:

    (expression1 | expression2 | expression3 | expression4 | expr
    nation products and maximize the revenues. But the companies involved in this practice are overlooking that they are burdening the patients both economically
    ession5)

    What we are trying to do here is to match the name field to the patterns in expression 1, 2, 3, 4 or 5. If you look at the regex closely, you
    and physically. They need to rightly judge the benefits of the combination products and they have to even look at the risks involved when combining the produ
    will see that expression1 is actually [[:digit:]].

    Expression2 is:

    [~`!@#$%^&*()_=+{}|:;<>"/?,]

    Noticed that I added a backslash () before each of th
    ts. Some of the combination products were well accepted by physicians while others suffered. Companies involved in development of combination products are fi
    5 characters "()+|". By backslashing these characters, I am telling the function to treat the characters as it is and not as special built-in character
    ding difficulty in defining their combination products and facing various challenges from selecting a combination to marketing it.

    Following aspects would a
    s. For example, the brackets "()" actually means grouping in regex but if I backslash it, ie "()", it simply means that I want to match "(" and ")".

    Ex
    dd to the challenges in developing combination products:

    Which markets to tap where the combination products can do fairly well?
    Which combination prod
    pression3 is "[", expression 4 is "]" and expression 5 is "-". We left out the 3 characters "[]-" in expression2 just to avoid confusion because we alre
    cts are meaningful and rational?
    Which therapeutic categories to select?
    Which Combinations can address unmet needs of the patients?
    Do combin
    ady used "[]" as the outer brackets. As for "-", we left it out because it is normally used as a range within the brackets "[]", like so [A-Z].

    Impl
    tions increase the patient compliance?
    What would be the developing cost?
    How to tackle the risks encountered during combination product developmen
    mentation

    To implement it in PHP, we write the code as follows:

    $pattern = '([[:digit:]]|[~`!@#$%^&*()_=+{}|:;<>"/?,]|[|]|-)+';
    $name = strip
    t?

    As combination products don't fit into the traditional categories of drugs, medical devices, or biological products, the USFDA is in the process of devel
    slashes({$_POST['name_field']});
    if (ereg($pattern,{$_POST['name_field']})) {
    echo "write your error message";
    }


    We stripslashed the
    ping new procedures for reviewing their safety, efficacy and quality.

    Professional from academic institutions, pharmaceutical industries, health care indust
    name field just in case your have magic quotes turned on. If magic quotes is turned on, the single quotation mark will be passed as ' instead just '. T
    y and representatives from various regulatory agencies are working out to design the regulatory requirements for manufacture and sale of combination products
    e ereg function will look for digits and illegal punctuations in the $_POST name field. If an error is found, we can do something such as alerting the u
    .

    As there is an increasing trend of the combination products companies manufacturing such products should be able to tackle the problems involved in the de
    ser of the error.

    Conclusion

    Hopefully, this article can give you some insight into regex and save you some time when verifying name fields. Yo
    elopment. They need to be wiser in analyzing the market trends and the regulatory requirements.

    Companies that provide selfless information through particip
    u can modify the regex to have stricter rules for example, you may not want the name field to start with a space or a period. That's all for now. Cheers


    tion in industry events and feedback to regulatory authorities would be able to face the challenges and will be successful in developing combination products

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.adviceyou.org.ua/article/86911/adviceyou-Form-Checking--Verifying-Name-Using-PHP-Ereg.html">Form Checking - Verifying Name Using PHP Ereg</a>

    BB link (for phorums):
    [url=http://www.adviceyou.org.ua/article/86911/adviceyou-Form-Checking--Verifying-Name-Using-PHP-Ereg.html]Form Checking - Verifying Name Using PHP Ereg[/url]

    Related Articles:

    Nylon is a Man-made Fibre

    What Not To Do...

    Click Fraud And What To Do About It

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com

    limousines to chicago Miasto rodzinne - Brzechwa Jan Pan od przyrody - Herbert Zbigniew Rozmowa o poezji - Grochowiak S. Dzikie wino - GaƂczyƄski Konstanty Ildefons