Regular Expression for Lux Map Making

Dreamweaver's imagemap functionality is pretty handy for constructing the pairs of coordinates necessary to define countries on a Lux map.

The only problem is, the HTML coordinates are all strung together with commas, while the official spec for Lux maps requires that each coordinate pair be separated by a space.

Fortunately, splitting the long, comma separated string into nice neat pairs is easily accomplished with a regular expression search/replace. I used Smultron, but any text editor with regex search/replace should do. I put the coordinate string in a new document, searched for

'(\d+?),(\d+?),'

and replaced it with

'\1,\2 '

(The single quotes are only there to illustrate the space after the \2 backreference; don't include them in the find/replace fields.) This should turn a string like

156,406,148,363,139,365,140,349,

into a string like

156,406 148,363 139,365 140,349

Which can then be copy/pasted into the luxb file.

Syndicate content

Twitter

  • RT @Crell An obituary for an old friend: http://bit.ly/gNdVIl #Drupal #Git #CVS 3 years 24 weeks ago
  • (That is to say, in hook_views_data(). #views #drupal) 3 years 24 weeks ago
  • #drupal #views3 gurus: Is it possible to declare a relationship with an intederminate base table & field? (TBD by the handler?) 3 years 24 weeks ago
  • I wrote a module and someone else figured out how to use it to pull Webform data into #Drupal views. http://bit.ly/hGDGGi 3 years 30 weeks ago
  • RT @nquabbinlodge Meeting tonight in Athol MA! Work of the evening: confer the 3rdº on 1 candidate. Dinner at 6, lodge opens at 7. 3 years 35 weeks ago

Older

Contact

Andy Chase
(978) 297-6402
andychase [at] gmail.com
GPG/PGP Public Key