Skip to content
OddsockLocal
Local
Source text

Formatting

4 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the text.
  2. Choose Pattern: emails, urls, hashtags, mentions, numbers or phones.
  3. Read the source, the flags and each match with its index.
  4. Copy the source into the tester if you need to change it or run a replacement.

What is Regex patterns?

The library is a fixed menu, not a blank pattern box. Pattern defaults to emails: [\w.%+-]+@[\w.-]+\.[a-z]{2,} with flags gi. Against Write ada@example.test or skip. the only match is ada@example.test at index 6. The surrounding words are not matches. The other choices are urls, hashtags, mentions, numbers and phones.

Read more

You do not edit the expression on this page. If the email pattern is too loose or too tight for your list, copy the source from the result and take it to the tester, where flags and a replacement exist. The result JSON includes the source and the flags so you can see what actually ran. An empty match list is a real answer when the text has no email.

These patterns are practical, not RFC proofs. The email one does not implement the full address specification. The phone one accepts several common groupings and will also hit numbers that are not phone numbers. Treat a match as a candidate.

Use cases

  • A paragraph contains one address, ada@example.test, and you want that hit and its index without writing the character class.
  • You need the email pattern’s source written out so you can tighten it in the tester.
  • A post’s hashtags or @mentions should be listed with the built-in unicode pattern rather than \w, which would split on some letters.
  • You want a reminder that no match is an empty list, not an error, when the sentence has no URL.

The email pattern against a sentence

Pattern emails. Text: Write ada@example.test or skip.

pattern [\w.%+-]+@[\w.-]+\.[a-z]{2,}, flags gi, one match ada@example.test at index 6.

Why use Oddsock

The source is part of the result so you can see the pattern you are trusting, instead of a label that only says emails.

Related tools

Using this tool

No. It is [\w.%+-]+@[\w.-]+\.[a-z]{2,} with the gi flags. Quoted local parts, comments and IP domains are outside what it finds.