Giter Site home page Giter Site logo

gskinner / regexr Goto Github PK

View Code? Open in Web Editor NEW
9.6K 176.0 951.0 2.46 MB

RegExr is a HTML/JS based tool for creating, testing, and learning about Regular Expressions.

Home Page: http://regexr.com/

License: GNU General Public License v3.0

HTML 4.43% JavaScript 76.88% CSS 0.96% PHP 13.09% SCSS 4.64%

regexr's Introduction

RegExr

About

RegExr.com is an online tool to learn, build, and test Regular Expressions. It was created by Grant Skinner and the nice people at gskinner.com.

Features

  • Results update in real-time as you type.
  • Supports JavaScript & PHP/PCRE RegEx.
  • Roll over a match or expression for details.
  • Save & share expressions with others.
  • Use Tools to explore your results.
  • Browse the Reference for help & examples.
  • Undo & Redo with cmd-Z / Y in editors.
  • Search for & rate Community patterns.

Issues & Feature Requests

Please report issues & feature requests on GitHub. Please do not post questions about regular expressions (use Stack Overflow instead).

Contributing

If you would like to contribute back to RegExr.com please send us pull requests.

Please make sure they are well formatted and follow the style specified out in the existing files.

License

This version of RegExr is licensed under GPL v3. If you're interested in using the source under other terms, feel free to get in touch.

Build

RegExr uses Gulp to manage the build process. You will need to install Node and Gulp, and install other dependencies via npm install. Running gulp (default) will run dev builds and set up a test server.

regexr's People

Contributors

alundiak avatar antibland avatar bbodenmiller avatar gskinner avatar mikechamberlain avatar ms5984 avatar tehvgg avatar wdamien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

regexr's Issues

Support other RegEx flavours.

It would be nice to support other RegEx flavours. This is a major task, requiring a number of different enhancements:

  • UI for selecting a flavour and conveying info about it.
  • The lexer classes would need to support some kind of feature map to enable / disable features in syntax highlighting (and of course be updated to support a ton of new tokens).
  • Similarly, the reference would need to hide or clearly mark unsupported features (and documentation would need to be added for the new tokens)
  • The engine and UI would need to be updated to support modular "solution" engines, which could be synchronous (client-side: JS, AS3), or asynchronous (server-side: PHP, perl, ruby, etc).

For now, this issue will just be a place to brainstorm approaches, and identify challenges.

Deal with python style named groups

The v1 of regexr was able to handle regexs with the python named groups tags inside of them. E.g. (?P<name>...)

For example the regex ": (?P<capture>.*)\\n[A-Za-z-]+:" happily works in v1, but in v2 I get an error "Invalid Target for Quantifier"

Not working without internet connection

I have clone this rego in my computer and then I build the package using grunt as instructed in README file. But I can't make it run without internet connection. How can I run this apps without internet connection?

Mixed content warning when self-hosting over SSL

When self-hosting and using SSL Firefox throws a mixed content warning requiring user interaction for regexr to fully load.

Line 81 in index.html change from:

<script src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"> to <script src="https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"> gets rid of the mixed content warning. Not sure if you want to change this or add some logic to detect if SSL is being used and automatically use the https version of Google APIs instead of http.

Newline substitution.

It appears to currently be impossible to substitute a newline in the output. This might be a limitation of the code mirror framework in use.

Named Capture Groups

Python's re library allows for named capture groups for example if my string is

symbolic link to `filea'

Then I could write a regular expression like this

/\`(?P<fname>[\w\d]+)\'/

This works in python however I get an error "invalid target for quantifier" under the P in regexr. Are named capture groups python specific?

don't support \w in cyrillic strings

And i suspect, it hits any non-latin word chars.

But, for example, php implementation supports \w correctly. As result, i cannot use regexr for designing regexes to be used in php projects ๐Ÿ˜Ÿ

Additional output options.

In addition to Substitution, it would be useful to be able to list out just the matches. There may be opportunity for other tools as output options as well.

Here's a very rough sketch of what that could look like.

screen shot 2014-04-07 at 3 39 05 pm

Zero width matches produce an error

Zero width matches, like (?=b), give an error saying that there are an infinite amount of matches for them (which is not true, of course).

Social Sign-in

Have you thought of adding a feature that users can login (via GitHub, Google Accounts, Facebook, Twitter etc) to sync their favourites, RegEx created by them, and (maybe) even saving test cases that they use often. Auto save can be included with this feature easier

Add screen button copy-to-clipboard

Selection of regexp with Ctrl+A or by mouse from the expression line selects just body not slashes and flags. It will be useful to add small button that copies full expression to the clipboard.

Can I disable keyboard shortucts?

Hi!
I'm happy to see the new RegExr. I love it. But I've a problem with this. I have an English-keyboard MacBookPro, but I'm hungarian, so I modified the keyboard layout.
For example "*" character is the "Alt+B" here, and the "[" is the "Alt+F". These shourtcuts makes something else (maybe a simple jump) in your software. Can I disable these shortcuts? It would be good...

Configurable delimiters

2.0 looks great! I'm excited about it.

I noticed there doesn't seem to be a way to change or remove the forward-slash pattern delimiters. This would probably be a useful feature especially since some environments do not require delimiters.

Sample text library.

To expand on the current sample Text, and present a slightly cleaner landing page, it might make sense to add a Sample Text section to the library, with expanded samples of different data types.

For example, "Phone Numbers" could contain a variety of numbers from different countries.

Phone, email, date/time, postal / zip codes, urls, html, ip addresses (incl IPv6), numbers, colors, code (comments, functions, etc), css.

I'm sure there are other categories, which people could request here or issue pull requests to add once the core feature is in place.

Quick reference card.

The Reference section is good for in-depth info & examples, but it might be nice to have a simple "quick reference card" or "cheat sheet" somewhere, that shows the most common tokens with a super brief description.

Ideas for placement:

  • If it was short enough, it could possibly replace the default content in the Library content area.
  • It could be a top level item in the Library, which would take over the full Library area when selected.

We could even deep link tokens into the Reference section, so people could drill in for more in-depth info & samples.

Matched result/groups are trimmed in tooltip

Currently the matched result and groups in the match tooltip are truncated to fit in the tooltip.
So there is no way to see if your groups have the correct match (at the end) when working with longer texts.

Are there any plans to improve this? Like a sidebar/panel to show the whole content of a single match including all the matched groups (with a scrollbar for the whole panel or per group).
Where the info shown is based on the selected group in the main editor.

Substitution Highlights

Can be the replaced text highlighted the same(ish) way as the matched text in Text window? It would be much easier to see the results everywhere than trying to find out if, how and where my substitution worked.

Thanks :)

Localized versions.

Requirements:

  • UI for selecting language, should remember choice
  • pull all text out into a single external file, and leverage templating for dynamic strings.
  • it might make sense to have two files: UI text + documentation
  • translate text

If you are interested in helping with translation (or any of the other steps), please comment below and subscribe to this issue, so you receive notifications when we start working on this feature.

Silently ignores extra input

There's a limit to how much text one can paste, but the tool silently ignores the extra content without giving a noticeable warning to the user. Ideally, the limit should be lifted, but in case that's not possible, at least some warning should be shown.

Default multiline matching

It appears multiline matching is on no matter what the checkbox says.
If you try for instance ^[^]*$ greedy matches all lines, instead of just the current line.

Update old saves

A few days ago, I could update an old save, but now I can not.
Not a big deal, but rather not have to update the URL 2-3 places in other GitHub repos.... Don't want to spam PRs every time I want to tweak some tests.

Add ability to collapse the library

It would be nice to be able to collapse the Library panel when it isn't needed.

Concept for collapsed view:
librarymin

Visual update for expanded view, showing new icon & slightly adjusted row item icons:
librarymax

Firefox 29.0.1 - "RegExr requires a modern browser"

When opening the page with Firefox 29 the message "RegExr requires a modern browser" pops up and doesn't permit to keep moving.

However, when I start an incognito window on the same Firefox then the page opens and works exactly as intended.

Perhaps a problem with cookies left after a Firefox upgrade?

Just wanted to share the feedback, you're doing a great work. This is the coolest regex UI I've ever found, using it since many years now.

Text files not loading

Dragging a text file to the text panel does not load its contents in the panel. Instead, the text file opens in a new browser tab. I am using IE9 and do not have the option try a different browser. Also, v1 is not loading in my browser anymore either. I only see the banner about using the new version instead.

Better handling of mobile & unsupported browsers.

The current handling of mobile devices is problematic, in part because the text is too small to read, and also because it's fairly non-specific.

Some mobile devices (Chrome on Android) seem to work fine with RegExr, and those that don't still generally render ok but lack functionality (ex. editing doesn't work in iOS).

We should break this into two solutions:

  1. Old browser (ie. missing required APIs): Current solution is ok, though it would benefit from a text size bump & revised copy. Something like: "RegExr requires a modern browser. Please update your browser to the latest version and try again."
  2. Mobile: Switch to an overlay (can we repurpose what we are using for the tutorial video?), and provide more specific content. We might also want to set a ~30day cookie and not show it again during that timeframe.

Mobile browser detected.
RegExr isn't optimized for mobile devices yet. You can still take a look, but it might be a bit quirky.

Invisible ampersand in expression

It seems that ampersands ('&') aren't visible when typed in the 'Expression' field, though they can be input. The following line was copied into the 'Expression' field:
"/\b([a-z])(?:-N-|&| (?:and|&) )([a-z])\b/ig"

And appeared as:
regexerror
(red arrow indicates invisible character)

The regex performed properly, even though the character was invisible.

Further test example:
Expression: "/&&/ig"
Result:
test2

Capturing Groups

v1 had a convenient "overview" section in the bottom where the capturing groups could be observed in a list
hopefully it is planned for v2 and will be as sophisticated as the HiFi Regex Tester table output
http://www.gethifi.com/tools/regex

faymbty 1

Bug: freezes tab when editing regex

When using Chrome/Internet Explorer, if I paste the following regex into the expression box: /{{(\s_[^\s{}]\s_)*}}/g

When deleting the first two curly braces, it immediately locks up the page, rendering it completely unresponsive. Can't click on anything, type, etc...

I would imagine this is because it somehow entered an infinite looping state.

Oddly enough, this happens only when on a freshly opened Regexr page, with the default test strings in place. I haven't been able to recreate this issue when the test strings are modified.

Hope this helps solve whatever the underlying issue is. For what it's worth, I absolutely love this tool and hope you continue the good work on it.

Inline flags don't work

First off, v2 looks great, nice job!

There are (at least) 2 things that work differently compared to v1. I'll make 2 separate issues for them.

Inline flags don't work anymore: /(?m)^./g does not get accepted (I know I can set the equivalent m flag in the upper right corner, but I type quicker than moving my mouse pointer all the way to the upper right corner).

Create desktop version.

I find the desktop app very useful. The web version with new UI is awesome. Can you please update the Adobe Air app as well?

Lookbehind support

Lookbehinds were supported in version 1 and they are missing in version 2. Is there a plan to fix this?

titleTxt in header please?

Would be nice to have the titleTxt displayed in the <title> &/or top-line of the site, between "RegExr v2.0" & by gskinner.

Match highlighting draws one line below matches

Loaded site (www.regexr.com) and default regex has highlighting errors. Top two paragraphs display fine, but highlighting for "Sample" and uppercased alphabet in the third paragraph is displayed on the line below the actual match. Resizing the browser window fixes the issue. It may be related to window width, but unfortunately I cannot reproduce and do not have a full screenshow showing window size.

Seen in Chrome 33.0.1750.154 on Win7.
regexr_chromebug

Add option to disable the confirmation upon leaving the page.

Currently for browsers that support the onbeforeunload event, when you try to navigate away from www.regexr.com, a JavaScript message pops up to ask if you really want to leave the page. It would be nice if there was an option you could set so that this is disabled (and this is remembered for each successive visit to the website).

Allow more characters in the text for matching

Not a bug... mostly a suggestion for improvement. Currently the textarea for placing the text that you would like to match allows up to 3K characters. It would be be nice to allow more characters... actually without any limit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.