22 ms·
RegExr 2.0
- shock 12y ago> Uh-oh, it looks like your browser is not supported. > RegExr only supports modern desktop browsers. I'm using Firefox 30 on Ubuntu. I think it's plenty modern :)
- jvehent 12y agoNo problem here with Fedora 20 and Firefox 31.0a1 (2014-04-04)
- LukeB_UK 12y agoI get the same message with chrome 34 on android 4.4.2
- isomorphic 12y agoI got the same message (FF28 Mac). Then I turned session cookies on and it worked. Obviously they need to fix the error message...
- ChrisGaudreau 12y agoReminds me of http://rubular.com/ http://rubular.com/, except it isn't Ruby-focused and is more community-based. Seems pretty cool.
- dehrmann 12y agoOr http://www.regexplanet.com/ http://www.regexplanet.com/, but regex planet supports a lot more flavors.
- RussianCow 12y agoOr http://re-try.appspot.com/ http://re-try.appspot.com/ for a Python equivalent.
- hardwaresofton 12y agoone of the best regular expression testers online just got better. Great site, love it
- nlh 12y agoI'm guessing the following is either near-impossible or pure-impossible, but: Is there a tool that allows you to highlight portions of a string and generate a corresponding regex? (i.e. the inverse of RegExr)
- chomp 12y agoRegexp::Assemble kind of gets you there, you can feed it strings and it'll spit out a regex.
- fancy_betta 12y agoProbably not what you're looking for, but check out http://nbviewer.ipython.org/url/norvig.com/ipython/xkcd1313.ipynb http://nbviewer.ipython.org/url/norvig.com/ipython/xkcd1313....
- deleted 12y ago[deleted]
- staticshock 12y ago"aaa" is a valid regex that matches the string "aaa". If you have special characters in your source string, many libraries have a regex for escaping them. So, generating a regex to match your exact string is trivial. Even matching a group of strings is trivial via (aaa|bbb|etc), though it gets long. Given that, what I think you're really asking is, "how do I automatically generate a regex of optimal conciseness given a set of inputs I'd like to match, and maybe a bunch of other inputs I want to avoid matching?" This looks like it iteratively does what you want: http://regex.inginf.units.it/ http://regex.inginf.units.it/ (Note that when I went there, it said "6 slots available", presumably because everything runs server-side. If a bunch of people pile in there, you probably won't actually be able to test it due to limited resources on their part.)
- mc_hammer 12y agothis is very cool ty for the post.
- gamegoblin 12y ago
- lelf 12y agoPeople just cannot do unicode even remotely properly. Just cannot. 𝄞 is one char, not two. привет is matched by \w+. PS there's some advanced stuff but where is basic [[:posix:]] char classes?
- Svip 12y agoIt doesn't support \p{} either for matching Unicode classes. e.g. \p{Lu} matches uppercase letters (so also Æ and Ö counts).
- core1024 12y agoI couldn't find a way to add the /u or /s flag. There are only allowed /i, /g and /m :(
- eurg 12y agoJust to make it clear: It does not even support the basic Latin-1 charset correctly. Matching my family-name requires manual intervention. This is sad. It seems a very nice regex page otherwise.
- dfc 12y agoFamily name = Grüneis
- gskinner 12y agoCreator here - can you elaborate? What is your family name? The example in this thread ("Grüneis") matches and displays correctly in all the browsers I've tested. Are you perhaps trying to use a RegEx feature that is not supported by JS? Currently, RegExr only supports the JS flavour of RegEx.
- deleted 12y ago[deleted]
- eurg 12y agoForget it, I was not used to JavaScript RegEx. I just looked it up on MDN, and it really defines `\w` to be very limited. Doesn't really make it any better, but whatever.
- tuananh 12y agoa side note: i found Patterns app on OS X very useful for regex.
- markbnj 12y agoVery nicely done. As someone else pointed out there are quite a few of these tools, but I think you've done a really nice job with this one. One suggestion: make the reference easier to scan at a top level as opposed to drilling down.
- bane 12y agoRegex testing is cool, but there are dozens of these kinds of tools and I'd really love to see some other kinds of regex tools - A list generator. Enter a regex, set repetition operator constraints (e.g. ->{0,3}, +->{1,3}, .->[A-Z0-9 ], etc.) and have it exhaustively generate a list of matching strings. This is helpful when you have a regex that matches your test strings, but also to let you know what else* it'll match. The constraints are to keep it from generating infinite lists. Even if it jams out tens or hundreds of thousands of produced strings, it's still useful. I've found that most people just build up the first regex that will "match" their input text, and move on without thinking about all the edge cases they've just introduced. - A regex assembler optimizer. Give it a few regexes, have it assemble them into one large regex and optimize it. It's got to do better than just | or'ing all the regexes together. I've seen some work done on using trie variants to do this, but have no idea how far along the work is on this. - A regex list generator. Give it a list of strings you want to match and have it generate a regex. A sliding "fuzziness" control could tell it to take alternates in the same character position and substitute either 1. Just the characters in the given list - a, t and q in the same position generates a|t|q 2. A representative narrow character range - if I give it a|t|q it knows to use [A-Z] while a|t|q|4 might generate [A-Z0-9] 3. A larger character range, a|t|q might just go ahead and produce [A-Z0-9] 4. An even larger character range, whatever it is, just use . And maybe another slider for repetitions, so if I end up with [A-Z][A-Z][A-Z], should it just produce [A-Z]{3} or can I go ahead and have it [A-Z]+ Jam the result through an optimizer (see previous idea above) to clean up the regex and maybe even run it through the list generator to check if it produces only what you want.
- jonny_eh 12y agoWhy don't you take a crack at it?
- aaronblohowiak 12y ago>- A regex assembler optimizer. Give it a few regexes, have it assemble them into one large regex and optimize it. It's got to do better than just | or'ing all the regexes together. I've seen some work done on using trie variants to do this, but have no idea how far along the work is on this. That should be unnecessary if your regex engine does the dfa transformation. basically, converts the regexp into a state machine and then it combines all of the branches in the state machine to generate synthetic states that can represent the "superposition" of matching multiple branches. this means your regex (once compiled) will run in bounded memory and max time proportional to the input (iirc)
- mck- 12y agoThere is one for Javascript that I use pretty often: http://scriptular.com/ http://scriptular.com/ (based on the Ruby one: http://www.rubular.com/ http://www.rubular.com/)
- strictfp 12y agoWhy can I not match against "\w*" for instance? It just says "infinite" and does not seem to attempt to match.
- gskinner 12y agoCreator here - this is because \w* matches 0 characters, and thus matches infinitely. You can roll over the "infinite" error for details, or look in the help. Try \w+ instead.
- strictfp 12y agoBut \w* matches "" and "abc" but not "!a". How can I test this with your tool if \w* always says "infinite"?
- cygni 12y agohttps://www.debuggex.com/ https://www.debuggex.com/ is a nice alternative that is a little different from other regex sites I've seen.