Giter VIP home page Giter VIP logo

js-regex's Introduction

JS Regular Expression Tester

Quick regular expression testing in JavaScript, using JavaScript.

When I'm working with Ruby and Regular Expressions I love using Rubular. I couldn't find a tool that was just like it but used JavaScript, so I built this.

The app is a small Ruby (Sinatra) app, purely as that was the quickest thing I could use to get it online through Heroku, where it currently lives. I guess I should have made it a Node app...but Sinatra was quicker for me personally to through a quick site together, and keep all the logic on the front-end.

The entire idea, and the quick reference guide was taken directly from Rubular. I'm not trying to outrageously copy, but I literally wanted the exact same site as Rubular, but for JavaScript. All credit to the idea, reference and general layout goes to Michael Lovitt. I just wrote some JavaScript that ties it together.

It also makes use of the jQuery highlightTextarea plugin by Damien Sorel.

Pull requests, bug reports and so on are much appreciated. If you're a designer and fancy making this look pretty, feel free.

Running the App Locally

  • you'll need Ruby (1.9) and Rubygems.
  • git clone [email protected]:jackfranklin/JS-Regex.git
  • cd JS-Regex
  • bundle
  • shotgun -p 1234
  • open http://localhost:1234

Changelog

v0.0.2

  • remove text highlighting - unreliable and buggy
  • limit regex loop to 100 executions, fixes the infinite loop bug #3
  • allow user to add Regex options, closes #1

v0.0.1

  • initial release

js-regex's People

Contributors

jackfranklin avatar yawboakye avatar

Stargazers

Peter Galbavy avatar Jon Repp avatar Vladimir Pestov avatar Inno avatar  avatar Joohun, Maeng avatar thunder avatar Neil Carpenter avatar NERDDISCO avatar Rodolfo Caldeira avatar Andrew Nesbitt avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

inno-v

js-regex's Issues

Re-rendering matched groups

If the regex is a single character, the view showing the matched groups is not cleared when either the regex or the test string is cleared

Ability to save Regexes

No need for user accounts or any of that stuff, but one of the things Rubular does is let you save a Regex and get a URL for it. Would like to add that same functionality in. Easy enough to do, only needs a tiny DB to save the URL, regex and content.

Regex Mismatch

The following regex

^space

Appears to match all occurrences of space on a line e.g.

space space space tree space

Infinite Looping

If you manage to add a regex that matches everything, due to the way it currently loops round, it will just infinitely loop and crash the page.

Highlighting on IE(9) is 1-2px out?

Open IE (I'm using v9) and set a regex of [a], now keep typing a as the text to match.

As you type more and more you can see the yellow highlight isn't covering the whole char and by the time you get to around 10-12 chars it's not highlighting a whole char. Get to around 30 chars and it's no longer highlighting 2 chars and so on.

Seems like an issue with jQuery's matchhighlighter thing not spanning the width of chars?

Reminds me why I like vanilla JS now ;-)

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.