explorers' club

explorations in dev, science, sci-fi, games, and other fun stuff!

Quick find and replace using Regular Expressions in Eclipse + Flex

Leave a comment

Note to self:

I had the tedious task of removing explicit widths from nearly 150 data grid columns as we had implemented an internal sizing mechanism based on maxChars and headerText.  After manually deleting about 10 of these, I decided to find out how to use Regex in Eclipse to remove them all for me.

This is specific for width but you could do this with nearly any property:

Basically you see the “width” property.  The next set of specialized characters are the following in oct char codes (note: in order for these to properly show I had to add a space between \ and the number):

  • \ 0075 = =
  • \ 0042 = “
  • \ 0173 = {
  • \ 0175 = }
  • [a-zA-Z0-9. _]* = any alphanumeric character of any case, ., (space) or _ for an indeterminate length.

If somebody else has a better formula for this, please let me know so that I can update this post.  Thanks.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s