Thursday 3 April 2008

Having problems with string matching / replacing in Java?

I find it almost impossible to write Java regular expressions correctly first time. They are pretty hard to get your head around (unless your head is a peculiar shape :-)

A trial-and-error approach is much eased by FileFormat's Regular Expression Test Page. At the bottom of the page you'll find a number of links to useful references and tutorials, which may help you eliminate some of the error from this approach.

The site is worth bookmarking anyway for its range of format conversion tools and information about file extensions.

1 comment:

APC said...

I'm a big fan of the Regex Coach http://www.weitz.de/regex-coach/

which, being a client program, has the advantage on not needing a web connection.

Cheers, APC