Skip to content
OnlineCop edited this page Mar 15, 2023 · 8 revisions

FAQs

  1. Is there an offline app for regex101?
  2. How to prefill the fields on the interface via URL?
  3. How to get / link the latest/newest version of a regex URL or entry?
  4. How to input control character on regex101?
  5. How close does regex101 emulate the engines?
  6. Why is regex101's result different from PHP's for regex specifying non-ASCII character without u flag?
  7. Is there a limit on the size of the input fields?
  8. Is there live help available?
  9. Will you open source Regex101?

Is there an offline app for regex101?

The website utilizes service workers under the hood, which means, if your browser supports them it will run offline. Nothing is stored or required from the server (after the initial load has been made) which means it can run offline without any hiccups. You can see the issue related here: https://github.com/firasdib/Regex101/issues/76

How to prefill the fields on the interface via URL?

For most of the cases, you should be using permalinks instead. This can be done through the UI or the API. If this still does not suit you, you can prefill the fields using query parameters like so:

https://regex101.com/?regex=<regex>&testString=<text>&flags=<flags>&subst=<replacement>&delimiter=<delimiter>

Note that the content of a permalink will override these flags.

How to get / link the latest version of a regex URL or entry?

Append /latest to a regex link rather than the version number. For example: https://regex101.com/r/JvLFcG/latest

How to input control character on regex101?

You shouldn't test those on an online tester in the first place. There is no support for it, but you can always try to hack it in yourself with a client side script.

From https://github.com/firasdib/Regex101/issues/257

How close does regex101 emulate the engines?

For PCRE, regex101 compiles its library from PCRE 16-bit library, while PHP uses PCRE 8-bit library, so there are discrepancies in non-UTF mode (see the question below). Other discrepancies are caused by differences in regex101's and PHP's implementation of matching and replacement functions.

Known issue: https://github.com/firasdib/Regex101/issues/216

For JavaScript, regex101 uses the browser's regex engine, so you may see different results on different browsers for the same test case.

For Python, regex101 implements it on top of PCRE library, by suppressing features not available in Python. However, there are minor differences which have not been ironed out.

Check the list for known issues.

Why is regex101's result different from PHP's for regex specifying non-ASCII character without u flag?

It's mainly because regex101 is compiled from PCRE 16-bit library, while PHP uses PCRE 8-bit library. This means that in default mode, the regex and the input are treated as an array of UTF-16 code units on regex101, instead of an array of bytes in PHP.

Unless you are working with binary content, always turn on UTF mode with u flag to interpret both the regex and the input string as an array of Unicode characters.

Do note that the regex and the input string should be stored in UTF-8 encoding in PHP. Anyway, if you are not already storing string as UTF-8, you should start doing so.

See also https://github.com/firasdib/Regex101/issues/284

Is there a limit on the size of the input fields?

On client side, regex101 doesn't impose any limit. You are only limited by your browser and the processing power of your machine.

When you save your regex as permalinks, there is a limit of 64 KB for the regular expression, the test string and the replacement string each. Data beyond the limit will be declined.

From https://github.com/firasdib/Regex101/issues/132#issuecomment-56272586

Is there live help available?

Feel free to drop in IRC channel at https://web.libera.chat/?nick=regex101-?&chan=#regex

Will you open source Regex101?

No. I (Firas Dib) have no plan to do that for now.