Return to Snippet

Revision: 56323
at March 22, 2012 03:08 by pflangan

Initial Code
search for: elseif\s*\(\s*id\s*=\s*([0-9]+)\s*\)\s*then

replace with: case "$1" \n

Initial URL

Initial Description
Requirement from work was to refactor an 8000 line if elseif code block to select case syntax. Not a manual task, even for a 1984 olympics button bashing champ.

note, id is the test variable here, 
as in
elseif (id ="test") then ...

Initial Title
regex to refactor elseif block to select case format

Initial Tags
regex, ASP

Initial Language
Regular Expression