Regexbuddy, one of the regular expression tools in Windows

Source: Internet
Author: User

As the saying goes, to do a good job, you must first sharpen it. We recommend regexbuddy and powergrep for the regular expression tool in windows. In Linux, there are also good Regular Expression tools, such as those of grep, but they are all based on command lines. These two Windows Gadgets are highlighted by visualization, allowing you to try and preview, greatly facilitating users.

Regexbuddy: the URL is a http://www.regexbuddy.com. When writing a regular expression, it provides visual support, prompts, and debugging convenience. When using a regular expression, it unselfishly converts the regular expression into strings in multiple languages, also providesCodeOutput function. Regular Expression assistant.

Basic Interface

The basic functions of the regular expression are nothing more than search and replacement. In this article, we use the regular expression matching email. The Code is as follows:

?[Copy to clipboard] View code Perl

\ B[A-Z0-9 ._%-]+ @[A-Z0-9.-]+\.[A-Z]{2,4}\ B

At this time, the regexbuddy Interface

When you click "Explain token", you can give a detailed explanation of the role of the current regular expression segment. For example, when you move the cursor to \ B and then click explain token, the help document will be activated and the word boundaries section will be automatically located.

If you want to test and verify the regular expression you just compiled, click "test" for testing. At this time, enter the text to match the test in the text box below, such as the dog@animals.com, the matching result is marked with a yellow background color. In this example, youMaybeThe matching is not correct. Why? For the answer, seeArticleEnd.

Copy and paste

Regexbuddy can copy the Regular Expression in multiple string formats. Or the regular expression just now. It can be copied as follows as needed:

?[Copy to clipboard] View code Perl

'\\B [A-Z0-9. _ %-] + @ [A-Z0-9.-] +\\. [A-Z] {2, 4}\\B'"\\B [A-Z0-9. _ %-] + @ [A-Z0-9.-] +\\. [A-Z] {2, 4}\\B"'/\\B [A-Z0-9. _ %-] + @ [A-Z0-9.-] +\\. [A-Z] {2, 4}\\B/I'

The specific options are shown in the copy menu, as shown in. You don't have to worry about single double quotes and forward and backward slashes.

Similar applications are also available in paste menu items.

Regular Expression-> code

If you want to apply the compiled regular expressionProgram, Here is an option: Use, see:

When you click between match and replace, the code is automatically adjusted accordingly. When you select different languages, the code is adjusted accordingly. It supports the following language formats:

    • C #
    • Delphi (net/Win32)
    • Java/JavaScript/ecmascript
    • PCRE
    • PHP
    • Perl
    • Python
    • Realbasic
    • Ruby
    • VB

In addition, it also has function options to implement the following functions:

    • If/else branch whethe the RegEx matches (part of) a string. If/else verify that the regular expression matches the string (part ). The most common features.
    • If/else branch whethe the RegEx matches a string entirely. If/else verify that the regular expression matches the entire string.
    • Get the part of a string matched by the RegEx. Obtain the part of the string that matches the regular expression. Get the part of a string matched by a capturing group. Get the matching capture group in the string. I just learned this article and it is very useful.
    • Get an array of all RegEx matches in a string. Save all matching strings to the array.
    • Iterate over all matches in a string. Lists All matching items in a string. (For example, when the regular expression '\ W' is used to match the string 'abc', the content listed in this function is 'A',' B ', 'C '.). The meaning of the word iterate isRepeated.
    • Comment with regexbuddy's RegEx tree. Comment on the regular tree of regexbuddy.
Text split

If the text to be processed is separated by certain delimiters that can be described in regular expressions (for example, HTML tags), the split function of regexbuddy can be used to show its advantages. I opened a meal webpageSource codeIn the message section (<DivID=The text in "stream"> and </div> is processed. The following regular expression is used to delete all angle brackets and only common text is left.

The regular expression used is:

?[Copy to clipboard] View code Perl

<[^>]+>

For the software interface and running result, see.



End:

As for the small questions raised at the beginning of this article, you may be able to see the answer right away! See:

Select the case insensitive option! If you do not find it, it may be because the software is in English and you have not noticed this option for a while; or you are not familiar with the regular expression.

Software Download

As mentioned above, its official website is www.regexbuddy.com. You can download the latest version of this website for trial use.This software is commercial software.

    • If you miss a new version by accident, you only need to download the trial version;
    • If you think it is easy to use, prepare for common use, have enough money, and do not need a genuine version, you may wish to spend the US dollars to purchase;
    • If you like it, and you think that excellent network resources should be shared with friends for free, and you want to get the full-featured free version of the software, well, I will fulfill your needs, please leave a message (with email) after this article. I will send you a link to this little item (the latest version is 3.1.1, and the full-featured version I have at hand is 3.1.0, which is enough ).

The next article will introduce another RegEx tool: powergrep, which is coming soon.

This article is original to Rex. zhasm.

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.