Win a copy of Production-Ready Serverless (Operational Best Practices) this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Regular Expression Tester - for fun  RSS feed

 
Saloon Keeper
Posts: 5753
56
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mentioned a few days ago that writing a quick and dirty regular expression tester would only take a few lines of code. While this is true, once I started adding features it started to grow. I'm posting it here because someone may find it useful.
Features:
  • Runs  from command line.
  • Allows entering regex and text to be searched.
  • Show matches as well as multiple occurrences with find.
  • Show matching groups.
  • Keep track of the most recent regex's and test texts.
  • Allow editing of current regex and text.

  • In the code, the RegexTester class is the meat & potatoes. Other classes are there to support the user interface.
    The EditDialog was a hack at a modal dialog that allowed for a longer TextField for editing. (I'm sure there must be an easier way.)





     
    Carey Brown
    Saloon Keeper
    Posts: 5753
    56
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Sample run for pattern: City, ST Zip
     
    You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
    global solutions you can do at home or in your backyard
    https://www.kickstarter.com/projects/paulwheaton/better-world-boo
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!