Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

regular expression for alphanumeric value

Posted on by 2,385

I need to validate an attribute value for alphanumeric i.e. VF12345, 12345VF, vc1234, 345cf, fdf455ff,

I have used ^(\d+[A-Z]|[A-Z]+\d)[A-Z\d]*$ this expression but it accepts only uppercase letters. I need an expression that can accept upper or lower both along with numbers,

Any help will be appreciated.

thanks,

Dilip

*This post is locked for comments

  • gawasdilip Profile Picture
    gawasdilip 2,385 on at
    RE: regular expression for alphanumeric value

    Thanks all.

  • Verified answer
    Mithilesh Kumar Profile Picture
    Mithilesh Kumar 10,045 on at
    RE: regular expression for alphanumeric value

    Hi Dilip,

    You may try this (JavaScript).

           cString = 'VF12345';

           var pattern=/[^0-9a-zA-Z]/;

           if(!cString.match(pattern)){

    alert("valid");

           }else{

    alert("invalid");

           }

    Hope that helps

    Thanks

    Please mark my post as verified if you found it helpful

  • Verified answer
    Aileen Gusni Profile Picture
    Aileen Gusni 44,522 on at
    RE: regular expression for alphanumeric value

    Dilip,

    Check these links:

    stackoverflow.com/.../c-sharp-regex-to-allow-only-alpha-numeric

    www.autohotkey.com/.../RegEx-QuickRef.htm

    Hope this helps.

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans