Dates & Timesflags: g
Unix Timestamp
Match 10-digit Unix timestamps (seconds since epoch) for dates between 2001 and 2286.
Try it in RegexPro →Available in
JavaScript / ECMAScript code
jsJavaScript
const re = new RegExp("\\b1[0-9]{9}\\b", "g");
const input = "Created at 1712345678";
const matches = [...input.matchAll(re)];
console.log(matches.map(m => m[0]));Uses `String.prototype.matchAll` for global iteration (Node 12+ / all modern browsers).
Python (re) code
pyPython
import re
pattern = re.compile(r"\b1[0-9]{9}\b")
input_text = "Created at 1712345678"
for m in pattern.finditer(input_text):
print(m.group(0))Stdlib `re` module — no third-party dependency. Works on Python 3.6+.
Go (RE2) code
goGo
package main
import (
"fmt"
"regexp"
)
func main() {
re := regexp.MustCompile(`\b1[0-9]{9}\b`)
input := `Created at 1712345678`
for _, match := range re.FindAllString(input, -1) {
fmt.Println(match)
}
}Uses `regexp.MustCompile` (panics on bad patterns at startup) and `FindAllString` for all matches.
Pattern
regexengine-agnostic
\b1[0-9]{9}\b (flags: g)Raw source: \b1[0-9]{9}\b
How it works
Anchored with word boundaries, matches exactly 10 digits starting with 1 — which covers epoch seconds from roughly 2001-09-09 (1 billion) to 2286.
Examples
Input
Created at 1712345678Matches
1712345678
Input
1609459200 = 2021-01-01Matches
1609459200
Input
no timestamps hereNo match
—Common use cases
- •Log file timestamp extraction
- •JSON API payload parsing
- •Database column normalisation
- •Event stream correlation
Related patterns
European Date Format (DD/MM/YYYY)
Dates & TimesMatch European-style dates in DD/MM/YYYY format with valid day (01–31) and month (01–12) ranges.
ISO 8601 Date
Dates & TimesMatch dates in ISO 8601 format: YYYY-MM-DD with valid month (01–12) and day (01–31) ranges.
US Date Format (MM/DD/YYYY)
Dates & TimesMatch US-style dates in MM/DD/YYYY format with range validation.
12-Hour Time with AM/PM
Dates & TimesMatch 12-hour time formats with AM or PM suffix — e.g. 9:30 AM, 11:45:15 pm.