Regular Expression Builder

Source: Internet
Author: User
Regular

Click here to download the source file

Note:


1, this is alpha (I have a lot of things only alpha version), so it's not guaranteed to be completely correct, only can be said to be able to use.


2, so please remember to save a little more, otherwise it is possible because a exception causes the program to terminate, then your work is completely lost!


3, personal belongings, retain the copyright.


4, Free & free to use, but please bear the consequences of the Independent. I do not offer any guarantee.





Use instructions:


1, open and save in the fourth page (very ugly, this is I casually drag and drop out of the mess), Please try to choose to use the text to save. (The previous File menu is not available, and has now been modified to become usable.) )
2, edited on the first page.


3, when editing, If an existing item is selected, it means that the item is modified , including modifying the name or content.


4, if the new words, please click on the list of "Click here to add".


5, continuous add mode refers to, click the "Add" button (or enter) automatically empty content, continue to new.


6, the input format is as follows:
A. Name:context


represents the context with name as the name


B. Where name does not accept *?+<>{} ()/equal characters


C. If the name begins with an "_" (underlined), it means that the definition does not need to be captured by a particular group. Otherwise, the group capture is named with that name. eg
<_name>:a
<name>:b
The former represents the time when a <_name> is replaced with a, which means that the time to encounter <name> is replaced with (? <name>b)


The format of the
D. Context is extended on the basis of standard regular expressions, so ordinary regular expressions are accepted here, and the extension section looks at the next one.


E. In the context can use &lt;name&gt; to represent a defined content (if not yet defined, it will be displayed in red characters, otherwise it should be blue), the following can be directly with +*? {N,m} is a duplicate item. Therefore the context "&lt;" (left angle bracket, less than number) needs to be escaped with \.


F. There may be times when the panic occurs at the time of editing, because there is a problem with the syntax parsing regular expression I'm using. (So save a lot!) Or you're going to die ugly. The solution is: to write complete with Notepad, copy up, the general will not have problems.


7, the text box underneath the edit box is an automatic expansion window where you can preview the entire expression, or copy and paste to test it. Note: Do not copy the previous "name:", this is not the content of the regular expression.
8, test in the second page, the NFA is actually regular expression, test characters refers to the input text, the test results represent the matching situation.


9, you can remove the check group, view capture, if you do not want to show which groups of capture, or do not want to know the specific capture.


10, the capturing group will generally display the name of the group you defined.


11, in the third page is the current tree chart, each node below is the current node contains the non-terminator. Selecting a node displays the definition on the right and its expansion. Here you can easily grasp the specifics of this regular expression. Here can also copy the expansion of a node, for local analysis. For example: You find that _root this regular expression does not match, you can see if each of the following non-terminal is able to make a partial match correctly, so it is easy to find out the problem.
12, in order to give you a better understanding of the entire use of the way, specifically to you with two very practical examples. RXSEARCH2 is the regular expression of the parser for the software itself (at least the syntax is highlighted and there are some other places to use). The PDA Accelerator test is my PDA's regular expression for the source-level accelerator analyzer. You can look at the tree structure, you know it looks easier to understand, and the design is also more relaxed.





In fact, this software is just a prototype, in order to be able to analyze the format of the extended regular expression that I defined, I need a structure to parse the string of things, a bit like using the compiler to compile the compiler's source code feeling. Although shabby, but I put it down, used to build a lot of things. A lot of simple regular expressions that take 10 minutes to do very well. (I mean 100% right)







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.