Любой хороший создатель регулярного выражения программные или сетевые инструменты для создания [закрытых] Регулярных выражений

// Options is a list box

private void MoveUpButton_Click(object sender,EventArgs e) {                            
    int index = Options.SelectedIndex;                                          
    if (index <= 0) return;
    string item = (string)Options.Items[index - 1];                         
    Options.Items.RemoveAt(index - 1);                                                                              
    Options.Items.Insert(index,item);                                           
    selectedIndexChanged(null,null);                                                                        
    }

private void MoveDnButton_Click(object sender,EventArgs e) {                            
    int index = Options.SelectedIndex;
    if (index + 1 >= Options.Items.Count) return;
    string item = (string)Options.Items[index];
    Options.Items.RemoveAt(index);
    Options.Items.Insert(index + 1,item);
    Options.SelectedIndex = index + 1;
    }

// sent when user makes a selection or when he moves an item up or down

private void selectedIndexChanged(object sender,EventArgs e) {
    int index = Selected.SelectedIndex;
    MoveUpButton.Enabled = index > 0;
    MoveDnButton.Enabled = index + 1 < Selected.Items.Count;
    }
38
задан Alan Moore 31 July 2009 в 02:00
поделиться

10 ответов

Вот хороший онлайн-инструмент для регулярных выражений: www.gskinner.com/RegExr/

40
ответ дан 6 July 2019 в 17:09
поделиться

Creating regular expressions without having any clue about them doesn't work. But you can make use of software that helps you create them. I heard that regexbuddy should be quite good.

EDIT

Reasons why creating regexes from arbitrary strings cannot work can be found in the answer to this question

8
ответ дан 6 July 2019 в 17:09
поделиться

Expresso has a regex GUI builder.
Но я бы рекомендовал потратить немного времени и изучить регулярные выражения - вы сможете создавать выражения намного быстрее, чем с помощью графического интерфейса помощника-строителя

Правка: Но он все равно не будет читать ваши мысли. Вам нужно построить регулярное выражение по частям ... в том смысле, что мне нужно 3 цифры, затем - и так далее ... Он не может догадаться, что вам нужен номер телефона с соответствующей строкой

5
ответ дан 6 July 2019 в 17:09
поделиться

I'm also a fan of RegexBuddy, but if you're working on a tight budget you can also use the open source (and free) utility called Kodos. It was originally designed for debugging and creating regular expressions for Python, but you can use it to validate any regular expression.

Of course, it will still rely on you actually knowing how to construct the regex, but at least you can use it to validate or test what you have.

3
ответ дан 6 July 2019 в 17:09
поделиться

I'm surprised no one has mentioned Regexlib yet

2
ответ дан 6 July 2019 в 17:09
поделиться

The human brain will create better and more readable regexes than any RegexBuddy. Regardless of how much a piece of software may help you develop faster regexes, there are several problems you'll have with these regexes:

  1. They'll probably look pretty awful, and enforce the idea of regexes as write-only.
  2. They'll probably be inefficient, and use weird/unnecessary solutions.
  3. You won't understand what's going on in the regex, which means you'll be a cargo-cult programmer.

In the end, learning regular expressions will make you a better programmer - you'll be able to read other people's code and understand what it does, as well as being able to write your own regexes on the fly, which will usually be faster than stopping your coding workflow, turning to some external program, coming up with a list of test cases that should pass or fail, and then copying and pasting the resulting generated regex into your code without knowing what it does.

1
ответ дан 6 July 2019 в 17:09
поделиться

Regex Coach мне очень помог - он поддерживает почти все тонкости регулярных выражений; вы видите в реальном времени, как ваши модификации работают со строкой; также имеет визуальное представление дерева синтаксического анализа.

3
ответ дан 6 July 2019 в 17:09
поделиться

Если вы используете Eclipse, то Regex Util от Сергея Евдокимова - одно удовольствие. Он находится прямо в вашей среде IDE, поэтому вы не потеряете его и обеспечивает мгновенную обратную связь по совпадениям. Затем он выполняет за вас все экранирование / отмену экранирования, пока вы копируете и вставляете его туда и обратно в свой код.

3
ответ дан 6 July 2019 в 17:09
поделиться

Мне нравится подсветка и дополнительные функции в RegexPal . Это бесплатный веб-инструмент, в котором легко найти краткий справочник. Вы даже заметите внизу, что они рекомендуют RegexBuddy для большей мощности, но вы по-прежнему найдете функциональность RegexBuddy в веб-приложении.

1
ответ дан 6 July 2019 в 17:09
поделиться

Я использую Rubular . Это не только для Ruby.

37
ответ дан 6 July 2019 в 17:09
поделиться
Другие вопросы по тегам:

Похожие вопросы: