Apr
15
2006

java.util.regex.Pattern tester – A one line Ajax app

For a while now I’ve been wanting a way to test out java.util.regex.Pattern regexs. So with a little bit of DWR and a one-line implementation using String.matches()… I’ve developed a java.util.regex.Pattern Ajax Tester – possibly the world’s most trivial Ajax app! Type in your patterns and click for red or green pattern matching goodness. At least it saves recompiling :-) .

Hope you all have a sensational easter. If you’re keen to explore religon a little more this weekend, I can definitely vouch for Christian City Church as a contemporary, energetic and relevant faith community. Sure to be one near you.
Have a great holiday.

About the Author: Glen Smith

3 Comments + Add Comment

  • Pattern: w+
    Text String: Hola Mundo
    Result: No Match

    Something is wrong, it must find two matches “Hola” y “Mundo”

  • Iago,

    I don’t think the w will match the space in your string. Behind the scenes it does a straight String.matches() using the values you supply so it has to match the whole string to return true.

    Could you do a word followed by an optional space with something like (w[s]?)+

  • Hi, thanks for your awnser, but in that test, i dont want match the spaces, only the words (like a StringTokenizer or csv parser). Ok i think that “Patter Tester”, could find more than one matches.This insue will be fine and could be cool, if the result (Match or No Match) show also the matches highlighted (whit css for example) in the whole word.
    After that sugestion, and understanding the goal of your app, just say, good job, and thanks for your response again.

Leave a comment

Glen Smith

About Glen

Co-author Grails in Action