Your own implementation of an online JavaScript regular expression tester--jre-parser

Source: Internet
Author: User

This article was originally posted in my personal blog: http://jerryzou.com/posts/jreparser/

Yesterday, while watching the 30-minute introductory tour of regular expressions, I saw that the blogger himself implemented a C# regular tester that looked very handy. But I don't really like to mess around, so I'm wondering if I can implement a javascript regular expression tester myself. So dozens of lines of code implemented such a regular tester.

Let's show you the 0.1 version.

The page is also relatively simple, but the basic features are. can be used normally ~.

The process of extracting a regular expression from a user's input thanks to the @依云 great God Point (Portal), the following solutions are available:

R is the user input string var jtester = function (r) {    var begin = R.indexof ('/');    var end = R.lastindexof ('/');    var flags = R.match (/\/([igm]{0,3}) $/i) [1];    THIS.R = new RegExp (r.substring (begin + 1, end), flags);};

If there's any better idea, you can always talk to me, or simply fork the repo I created on GitHub and pull request~. (Portal for Project on GitHub)

Finally, the address of this test tool is attached: http://zry656565.github.io/JRE-Parser/

Your own implementation of an online JavaScript regular expression tester--jre-parser

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.