Computer: Programming
Readable Regexp   (+3, -4)  [vote for, against]
Readable Regular Expression parser and WYSIWYG tool

Instead of strings like " .*(?=\.)"
Lets have:

matchCriteria:
..... str from source
..... where
..... str startswith Text.Anything
# until one before period
..... until (source endswith Chars.Period) - 1

Possibly a markup language (RegXML) that will store RegExp information for SOA messaging.

And a search tool for the desktop and for the web, with a WYSIWYG regexp editor that works as follows on any text:

a. Load sample or text to search.

b. Mouse over and mark the words or "sections" you are intending to search for inside the text.

c. As you mark, each section is given its definitions: if its from the beginning or till the end of a word it will give the possible [b]Word (starting/ending/exactly) with markedword[b].

d. When standing on a section, you can mark it as being a "formatted text" or other. (if the section has slashes, hyphens and periods etc, it will suggest this automatically).

e. Famous formats can be chosen and automatically detected.

For example: Search for format of date: where day is: (any/between/less than) etc.

f. Didn't think out the REPLACE functionality yet.
-- pashute, Jul 22 2009

Proof that it can be done http://xenon.stanfo...egexp/analyzer.html
The other way around: You write regexp, and it xplains it in plain English [pashute, Mar 11 2010]

SNOBOL http://www.snobol4.org/
Something like readable regexen, as I recall (it's been a long time) [mouseposture, Mar 11 2010]

https://regex101.com/ - a WYSIWYG regexp editor https://regex101.com/r/2NuDcD/1
In the absence of this idea, this site allows you to try out different regexes and visually see what they're up to. Hugely useful in figuring out these rather terse and tricky pattern matchers. [zen_tom, Feb 03 2021]

We have a natural language to regex convertor in the office. It's a person.

Whenever I have to create a regex (not very often) I just ask. It's usually quite scary because the answer comes back in less than a minute.
-- DenholmRicshaw, Jul 22 2009


Regular expressions in the perl5 programming language have options to that allow programmers to write verbose and comprehensible regular expressions.

Specifically, when the "/x" option is turned on, unescaped whitespace is ignored (so you can use spaces and newlines to seperate logically seperate parts of the regexp, and perl will ignore them while compiling the expression), and one can include comments (from a "#" symbol to the end of a line is a comment).

As for a WYSIWYG regexp editor... maybe you should split that idea off to a seperate idea.
-- goldbb, Jul 23 2009


I dont really understand why the fishbones. One funny anno about people in the office. One about not needing regexp all that much (I suspect because its not intuitive! If it would be, it would be used in all search engines) And one saying that you can add remarks in pearl.
-- pashute, Aug 05 2009


Yes, I've had the same thought. SNOBOL (link) deserved a better fate.

As for the fishbones, I have two theories

#1
When you suffer a lot to acquire a skill, you value it very highly. Good spellers despise simplified orthography, physicians insist that sleep deprivation builds character, and so on ....

#2
They're right, it's a bad idea. The problem's not with the regex syntax, so improved syntax isn't any kind of solution. The insane concision of regexen is a virtue when you're doing simple things on the fly. They just shouldn't be used where a programming language would be more appropriate.
-- mouseposture, Mar 11 2010


WYSIWYG regexp editor - I would LOVE one of them.

Anyway... [+] merely to counterbalance the undeserved bones.
-- wagster, Mar 11 2010


Thanks wagster
-- pashute, Feb 03 2021


Check out regex101 (see link) it doesn't rehash the old regex language, but it does do a great job of WYSIWYG-ing it. Fill the big window with your test conditions, and live edit your regex in the top - it will colour code your text, showing matches, and explain which bits of the regex are doing what.

I've copied some of the text from this idea, and put a regex in that extracts any rows of text starting with a character followed by a dot to collect your points a to f.
-- zen_tom, Feb 03 2021



random, halfbakery