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

  • SEARCH
  • Home
  • 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 7090675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:05:03+00:00 2026-05-28T08:05:03+00:00

I am trying to validate inputs that can be altered by users in one

  • 0

I am trying to validate inputs that can be altered by users in one shape way form or another. That are specific to longitude and latitude. So I am trying to come up with a regex that will validate the entry. So I can throw an exception if it doesnt match

The regex I am playing with via php preg_match is:

preg_match('/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/')

which doesn’t seem to work for me. I am trying to catch gps long/lat in the format like
-101.3335 and 71.5555 (of course I dunno how valid those specific numbers are but thats the general format)

  • 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-28T08:05:04+00:00Added an answer on May 28, 2026 at 8:05 am
    preg_match('/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/')
    

    Is actually a working concept. When I posted, and was having trouble with it I was initally failing to realize I couldn’t put one or the other as far as long/lat goes in. I would have to put them both in delimited by a , to get it to validate. Which someone pointed out in my comments to the inital post, I appreciate the help though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple form that will validate that the first password
I'm trying to find a quick and easy way to validate some inputs with
When im trying to validate my page on http://validator.w3.org/ i get one error that
I am trying to validate a User Profiling form in django and I can't.
I'm trying to validate that a submitted URL doesn't already exist in the database.
Hello there i'm trying to create a form with Zend_Form that will enable my
Right what I was trying to do is validate some input so that the
I'm trying to validate that the input a user gives my program via gets
I'm trying to validate a form using the validate plugin for jquery. I want
i'm trying to put together some Javascript form validation to check that all fields

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.