2

I am looking to find a way to convert a specific pattern to lower case for an entire Java project (target: *.jrxml).

Basically, I would like to find all expressions matching the following pattern: $F{TEXT_EXPRESSION}

and then send the TEXT_EXPRESSION string to lower case, so the result would be $F{text_expression}.

I am using Eclipse and I would like to specify a regular expression in the Search and Replace dialog.

Any advice regarding my requirement?

Thank you very much

Charles

Charles Morin
  • 1,449
  • 4
  • 32
  • 50
  • I haven't found any way to do it directly using the find and replace functionality in Eclipse. I coded a custom Java class that does the trick using the File class – Charles Morin Aug 22 '11 at 17:48

1 Answers1

0

I would use perl or sed. With perl:

perl -pi -e 's/\$F{(.*?)}/\$F{lc($1)}/e' `find [eclipse project folder] -name \*.jrxml`
Mike Sokolov
  • 6,914
  • 2
  • 23
  • 31