Morrnaire

Morrnaire

Regex Tester

A regex tester lets you write, test, and debug regular expressions in real time with syntax highlighting and match highlighting — essential for data validation, search patterns, and form input processing in Nigerian web applications.

//gm
Test string
Matches0 matches

Enter a test string to see matches

Saved patterns

No saved patterns yet. Type a pattern and click Save.

How to test regular expressions for Nigerian data formats

Type or paste your regular expression into the pattern field — the tool supports full JavaScript regex syntax including lookaheads and backreferences. As you type, matches in your test string are highlighted in real time; toggle flags like global (g) or case-insensitive (i) using the buttons above the input. Use the common patterns row to instantly load pre-built regexes for emails, Nigerian phone numbers starting with 070/080/090/091, Naira prices, or Nigerian BVN (Bank Verification Number) formats.

When should a regex tester be used?

Any time you need to validate or extract text patterns from user input — from checking that a customer\u2019s phone number matches the Nigerian mobile format (e.g., 08031234567 for MTN or 09051234567 for Airtel) to extracting BVN numbers from a loan application export. Developers building registration forms for Lagos startups, payment gateways integrating Flutterwave or Paystack, or content management systems for Abuja media houses rely on regex to enforce format rules before data reaches the database.

Practical use cases for Nigerian businesses

  • A Lagos e-commerce platform validating Nigerian phone numbers entered during checkout — ensuring customers provide valid MTN, Glo, Airtel, or 9mobile lines before payment is processed via Paystack.
  • An Abuja HR firm parsing thousands of CV submissions to extract email addresses, phone numbers, and job titles using capture groups and exporting results as CSV for analysis.
  • A fintech startup replacing sensitive data like NUBAN account numbers, BVN patterns, or GTBank card details in log files before sending them to external auditors.
  • A Port Harcourt logistics company extracting delivery addresses and phone numbers from WhatsApp order messages using regex, then formatting them into a structured database.
  • An Ibadan university validating student email addresses (e.g., @ui.edu.ng) and matriculation numbers during online registration.
  • A Kano-based agritech platform parsing CSV exports from Moniepoint to identify transaction patterns and reconcile payments.

Frequently asked questions

What does the Nigerian phone pattern match?

The built-in pattern 0[789]\d9 matches Nigerian mobile numbers that start with 070, 080, 090, 091, or 081 and are exactly 11 digits long — covering all major networks: MTN, Glo, Airtel, and 9mobile. You can modify the pattern to target a specific network prefix if needed.

How do capture groups work?

Wrap part of your pattern in parentheses to create a capture group. For example, (\d4)\s*(\d4) would capture two groups of four digits. The Match details panel shows each group\u2019s value so you can extract specific pieces of a match.

What is the difference between test string and multi-test strings?

The main test string is where you type or paste the bulk text you want to search. The multi-test strings feature lets you save several short inputs — for example, different phone number formats — and switch between them with one click to quickly verify your pattern against multiple cases.

Can I use the replace mode to transform text?

Yes. Enable Replace mode and enter a replacement string. You can use $1, $2 etc. to reference capture groups. For instance, replace (\d4)(\d4)(\d4) with $1-$2-$3 to format NUBAN account numbers into readable chunks, or remove the country code from international phone numbers.

Is my test data processed on a server?

No. All regex matching happens entirely in your browser — no data is sent to any server. This is especially important when testing patterns against sensitive data like customer records or internal database exports.

More free tools