topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 18, 2024, 8:13 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Reverse Regex Generator  (Read 10601 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
IDEA: Reverse Regex Generator
« on: March 08, 2007, 05:54 AM »
I'm not 100% sure the existing regex helper tools don't do this, and i suspect this may not be at all simple, but i'd love to see a little utilitity that could take a regular expression and generates some random test strings that match it.  It would be extremely useful i think.

Anyone know of such a tool or want to give it a try?

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: IDEA: Reverse Regex Generator
« Reply #1 on: March 08, 2007, 07:54 AM »
Hmm, that sounds like a really good way to get a handle on regular expressions. What better way to learn then to code them? Hmm.

[Tinjaw checks his schedule and ToDo list]

Hmm

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Reverse Regex Generator
« Reply #2 on: March 08, 2007, 08:10 AM »
Wow nice idea! I wonder if it's feasible though... *crunch crunch* :Thmbsup:
Regards,
RuffNekk

Programming is an art form that fights back.

Dr-Leech

  • Member
  • Joined in 2006
  • **
  • Posts: 151
  • Psychedelic Coder
    • View Profile
    • site
    • Donate to Member
Re: IDEA: Reverse Regex Generator
« Reply #3 on: March 08, 2007, 09:08 AM »
Nice idea. It's a pretty nice way to learn and play with RegExp. I always thought about something like it when creating a pattern

cthorpe

  • Discount Coordinator
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 738
  • c++thorpe
    • View Profile
    • Donate to Member
Re: IDEA: Reverse Regex Generator
« Reply #4 on: March 08, 2007, 10:00 AM »
I would love something like that.  I've always had a hard time getting my head around regexp.  I use them when necessary, but I always have to look at example after example and attempt to cobble a usable expression out of them.  Definately takes much longer than it should.  The problem is, when I try one that doesn't work as expected, I don't always know why.  If I had a way to see what the "wrong" expression returned, it would be easier to learn from my mistakes.

And if I could learn regexp...

regular_expressions.pngIDEA: Reverse Regex Generator
« Last Edit: March 08, 2007, 12:00 PM by cthorpe »

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: IDEA: Reverse Regex Generator
« Reply #5 on: March 08, 2007, 05:36 PM »
<:-*>.

I wonder how feasible the project is, though - RegExes are a pretty complicated thing to do right, and generating match-text? Ugh. Alternations, greedy vs. non-greedy asterisks, et cetera.

The Regulator has been pretty useful for me when dealing with regular expressions - in combination with Mastering Regular Expressions.
- carpe noctem