Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Geo
#longitude
#geo
#coordinates
#location

Longitude

Matches a geographic longitude coordinate between -180 and +180 degrees, with up to 6 decimal places.

✓ GPS coordinate input✓ Map integrations✓ Location-based services
/
/
Safe
Test String
7 matches
-?-— '-' — literal character — repeated zero or one time (optional) · ? — zero or one time (optional)
(…)Group #1— Capturing group — captures matched text for reuse or extraction
11— '1' — literal character
[…]Character class […]— Matches any single character listed in this set
\ddigit— \d — digit (0–9)
(…)?Group #2— Capturing group — captures matched text for reuse or extraction — repeated zero or one time (optional) · ? — zero or one time (optional)
||— | — alternation: matches expression on left OR right
[…]?Character class […]— Matches any single character listed in this set — repeated zero or one time (optional) · ? — zero or one time (optional)
\ddigit— \d — digit (0–9)
(…)?Group #3— Capturing group — captures matched text for reuse or extraction — repeated zero or one time (optional) · ? — zero or one time (optional)
||— | — alternation: matches expression on left OR right
11— '1' — literal character
88— '8' — literal character
00— '0' — literal character
(…)?Group #4— Capturing group — captures matched text for reuse or extraction — repeated zero or one time (optional) · ? — zero or one time (optional)
Pattern: 60 charsInput: 34 chars
100% client-side · private

✓ Valid Examples

  • -0.1278
  • 151.2093
  • 0
  • 180
  • -180.000000

✗ Invalid Examples

  • 181.0
  • -180.1
  • abc
  • 0.123456789

Usage & Integration

Validate Longitude natively in your backend or frontend without copying regex strings.

Node / Edge

import { validate } from '@regexto/validators';

validate('longitude', '...');

Python

from regexto_validators import validate

validate("longitude", "...")

Go

import "github.com/regex-to/validators-go"

valid, err := validators.Validate("longitude", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('longitude', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("longitude", "...").unwrap();