GithubHelp home page GithubHelp logo

tchigher / i-hate-regex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geongeorge/i-hate-regex

0.0 0.0 0.0 1.45 MB

The code for iHateregex.io ๐Ÿ˜ˆ - The Regex Cheat Sheet

Home Page: https://iHateRegex.io

Vue 88.56% JavaScript 10.84% CSS 0.14% Dockerfile 0.41% Shell 0.06%

i-hate-regex's Introduction

iHateRegex ๐Ÿ˜ˆ

PRs Welcome Nodejs CI

don't just use; understand.

iHateRegex.io - a regex cheatsheet for the haters.

Chat with us on Telegram

Features ๐Ÿ˜Ž

  • Visual representation of regular expressions
  • Matched strings - the Testing area
  • Embed regular expression visualization on your sites
  • Regex code highlighting and validation
  • Regex description with markdown support
  • Playground page where you can create your own expression and link to it.
  • User login and save regex

Setup ๐Ÿš€

  1. Install yarn

  2. Clone this repo

  3. Install dependencies โš™๏ธ

$ yarn install
  1. Test on localhost ๐Ÿ› 
# serve with hot reload at localhost:3600
$ yarn dev
  1. Build and Start nuxt server ๐Ÿš€
# build for production and launch server
$ yarn build
$ yarn start

This project is built with Nuxt.js ๐Ÿ™Œ

For detailed explanation on how things work, check out Nuxt.js docs.

Contribute Regex ๐Ÿ™

Contribute to this project and make this the largest collection of useful expressions ๐Ÿ˜

You can also submit regex via this google form

To contribute:

  1. Add your regex to /static/regex/data.json
Show sample JSON
{
        "id": "username",
        "title": "username",
        "tagline": "match a username",
        "description": "Alphanumeric string that may include _ and - having a length of 3 to 16 characters.",
        "regex": "^[a-z0-9_-]{3,15}$",
        "flag": "gm",
        "matchText": [
            "lorem",
            "ipsum",
            "gr3at",
            "a",
            "ab",
            "abcd",
            "abcde",
            "john doe",
            "johnny",
            "abcdefghijklmnopqrst"
        ],
        "cheatRegex": [
            "/^/",
            "/$/",
            "/[a-zA-Z0-9]/",
            "/(hello){1,3}/"
        ],
        "embedHeight": 300,
        "tags" : ["name", "slug"]
    },
Show JSON properties
Property Definition
id this is the slug and also the short name of the regex. cannot contain spaces and only contain url-safe characters
title Title of the page.
tagline Tagline
description First line under the tagline and also the meta description
regex The actual regex string
flag regex flags associated with the expression. eg; g
matchText Array(line by line) of strings to be included in the string matching are
cheatRegex refer static/regex/cheatsheet.json and see what all cheats are relevent to this expression. (you can also add your own cheats into cheatsheet.json and refer to that)
embedHeight Height in pixels of the regex visualization embed
tags tags related to the expression (to be used later)
  1. Create a markdown file in /static/regex/markdown/ named <regex-id>.md for longer description and explaination

    <regex-id> is the id from data.json

That's it ๐Ÿ™Œ Go ahead and shoot a new pull requestโœจโœจ

Descriptions

There are 2 descriptions for each regex.

  • One is the description property inside /static/regex/data.json.

    • This is used for page meta description as well.
    • This is the first description
  • Second is a dedicated markdown file in /static/regex/markdown/<file>.md

    • This should explain the working of the expression in detail
    • This is the long description
Property Definition example
description property inside data.json This should explain about what the target match is in a few lines. It should not contain any html or markdown A username is a unique identifier given to accounts in websites and social media
dedicated markdown file Explain about the expression and its working ip addresses are of the range 0.0.0.0 - 255.255.255.255. The expression matches the ....(more)

Sponsors ๐Ÿ’–

Donate via Opencollective

Credits

  • The visual demo is built with: regexper

i-hate-regex's People

Contributors

alex-hofmann avatar andraantariksa avatar diya-liza avatar ebolaware avatar eyarz avatar fcmam5 avatar geongeorge avatar huy-ngo avatar jamesgeorge007 avatar jjimenezshaw avatar ldsands avatar oussamabouchikhi avatar shimont avatar thejabbu avatar tylerdm avatar w3gaucho avatar yshalsager avatar

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.