Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3664936
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:42:09+00:00 2026-05-19T01:42:09+00:00

I’m working on an iOS Cocoa app that has a fallback – if the

  • 0

I’m working on an iOS Cocoa app that has a fallback – if the user doesn’t enter a certain piece of data, the device’s UDID is used instead, as a default. I need to add a check in our server code (written in Ruby) to recognize whether the value being sent up is a UDID (the user’s default) or a custom string that they’ve set.

It seems that the right solution to my problem is a regular expression. I’m comfortable writing regex’es, but I need to be certain that this regex is 100% guaranteed to recognize a UDID.

I retrieve the UDID in code using:

[[UIDevice currentDevice] uniqueIdentifier]

And in the simulator, I get back this value:

6938CA7D-ECE2-53A4-B293-961A8D07AFB1

From this I might infer that I can just search for a string of hex characters that matches the pattern 8-4-4-4-12. But I want to be certain this works for every UDID.

I can’t find anything about this in Apple’s documentation and was wondering if anyone could give me a definitive answer to this question… thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:42:09+00:00Added an answer on May 19, 2026 at 1:42 am

    Why not send another bit of data indicating that it is a UDID? Or just use a different parameter name (UDID=6938...).

    Then, in your server, you can test it like so if you really want to:

    # somewhere outside the controller action, maybe the top of the file
    UDID_PATTERN = /\A[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\Z/
    
    # inside the controller action you're sending info to
    udid = params[:UDID]
    if udid && (udid =~ UDID_PATTERN)
      # do something with the UDID in place of the other
      # bit of info they could have provided
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.