Get reference code
Appearance
Sample
List format

List format

Format a list using regular expressions
Timur2012-04-19 21:28:04

Once upon a time I've created calculator to unleash the power of regular expressions - Regular expression tester. Now it is a time to use it for practical purposes (via calculator reuse supported by our engine).

Sometimes you need to format a list, given you by your client (if we are talking about software development), to something more suitable for your needs, like computer processing. Of course you can do it with copy-paste, but this is not our method. Our method is to make computer do this for you.

Calculator below lets computer to perform such sophisticated job as list formatting.

You need to insert source list, write regular expression to match, leave modifiers alone - since "g" is global search and "m" is multiline mode (so you can use "^" and "$" in your regexp), and write replacement text - the desired format. "Escape tags" allows you to see tags in output list (i.e. html, xml).

Default values used to illustrate the concept. Common list is transformed to the list of values enclosed by <i> tags.

List formatterCreative Commons Attribution/Share-Alike License 3.0 (Unported)
Result: 

Request a calculator
View all calculators
(480 calculators in total. )

Comments