regexre2

Regular Expression Tester for Google RE2


I'm looking for a regular expression tester for Google Big Data (RE2) reg expressions. There are a few testers out there, but none of them seems to understand my statement. These are the ones I've tried and they've worked for simple expressions but not with mine:

This is my regex:

^(?:1-)?((?:R|RO|Ro)?[:|.]?\\s?\\d{3}[-|.]?\\d{4}[-|/]F\\d{2}-\\d{2})$

where I would process strings like these:

Does anyone have an idea of how I might enter the statement different or where I could test it?


Solution

  • You can use

    ^(?:1-)?((?:R[Oo]?)?[:.]?\s?\d{3}[-.]?\d{4}[-/](?:F\d{2}(?:-\d{2})?|\d{3}[-/]\d{3}))$
    

    See the regex demo. Details:

    See the Google Sheets demo:

    enter image description here