Skip to content
Jos Ahrens edited this page Aug 26, 2016 · 12 revisions

FAQs

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

Is there an offline app for regex101?

Since regex101 runs completely on client side, there are a number of third party apps available.

Check 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. Anyway, there is legacy support for this:

https://regex101.com/?regex=<regex>&text=<text>&options=<flags>&sub=<replacement>

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

How to input control character on regex101?

You shouldn't test those on an online tester in the first place. Anyway, you can work around by setting the regex_string testarea directly in the developer console:

$("#regex_string")[0].value = "test\0string\n"

Which characters are supported depends on the browser implementation, but \r\n sequence and lone \r are generally converted to \n.

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

How close does regex101 emulates 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 silently truncated.

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

Is there live help available?

Feel free to drop in IRC channel at https://webchat.freenode.net/?nick=regex101-....&channels=regex

Will you open source Regex101?

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

Clone this wiki locally