re = /(.*?)"(\w+)"\s+"([\w| .\/\\%]+)"/m
str = '
// General
//-------------------------------------------------------------------------------------------------------------
"BaseClass" "ability_datadriven"
"AbilityType" "DOTA_ABILITY_TYPE_BASIC"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET"
"AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_ENEMY"
"AbilityUnitTargetType" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
"AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
"SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_NO"
"FightRecapLevel" "1"
"AbilityTextureName" "rooting_shoot"
// Casting
//-------------------------------------------------------------------------------------------------------------
"AbilityCastRange" "500"
"AbilityCastPoint" "0.3 0.3 0.3 0.3"
// Time
//-------------------------------------------------------------------------------------------------------------
"AbilityCooldown" "9.0 8.0 7.0 6.0"
// Cost
//-------------------------------------------------------------------------------------------------------------
"AbilityManaCost" "115 125 140 150"
// Stats
//-------------------------------------------------------------------------------------------------------------
"AbilityModifierSupportValue" "0.5" // Applies multiple modifiers
// Special
//-------------------------------------------------------------------------------------------------------------
"AbilitySpecial"
{
"01"
{
"var_type" "FIELD_INTEGER"
"damage_per_second_tooltip" "50"
}
"02"
{
"var_type" "FIELD_FLOAT"
"duration_tooltip" "1.5 2.0 2.5 3.0"
}
"03"
{
"var_type" "FIELD_INTEGER"
"hero_damage_tooltip" "150 200 250 300"
}
"04"
{
"var_type" "FIELD_FLOAT"
"creep_duration_tooltip" "10.0 10.0 10.0 10.0"
}
"05"
{
"var_type" "FIELD_INTEGER"
"creep_damage_tooltip" "1000"
}
"06"
{
"var_type" "FIELD_FLOAT"
"damage" "100"
}
// Extra variable
"07"
{
"var_type" "FIELD_FLOAT"
"stun_duration" "0.1"
}
"08"
{
"var_type" "FIELD_FLOAT"
"damage_interval" "0.5"
}
"09"
{
"var_type" "FIELD_INTEGER"
"damage_per_second" "25"
}
"10"
{
"var_type" "FIELD_FLOAT"
"duration" "1.0 1.5 2.0 2.5"
}
"11"
{
"var_type" "FIELD_FLOAT"
"creep_duration" "9.5 9.5 9.5 9.5"
}
}
// Data driven
//-------------------------------------------------------------------------------------------------------------
"precache"
{
"soundfile" "soundevents/game_sounds_heroes/game_sounds_crystalmaiden.vsndevts"
"particle" "particles/leave_bite/leave_bite_06.vpcf"
"particle" "particles/leave_bite/leave_bite_01.vpcf"
}
"OnSpellStart"
{
"TrackingProjectile"
{
"Target" "TARGET"
"EffectName" "particles/leave_bite/leave_bite_01.vpcf"
"MoveSpeed" "2000"
}
"Stun"
{
"Target" "TARGET"
"Duration" "%stun_duration"
}
"ApplyModifier"
{
"Target"
{
"Center" "TARGET"
"Types" "DOTA_UNIT_TARGET_HERO"
}
"ModifierName" "modifier_frost_bite_root_datadriven"
"Duration" "%duration"
}
"ApplyModifier"
{
"Target"
{
"Center" "TARGET"
"Types" "DOTA_UNIT_TARGET_HERO"
}
"ModifierName" "modifier_frost_bite_damage_datadriven"
"Duration" "%duration"
}
"ApplyModifier"
{
"Target"
{
"Center" "TARGET"
"Types" "DOTA_UNIT_TARGET_BASIC"
}
"ModifierName" "modifier_frost_bite_root_datadriven"
"Duration" "%creep_duration"
}
"ApplyModifier"
{
"Target"
{
"Center" "TARGET"
"Types" "DOTA_UNIT_TARGET_BASIC"
}
"ModifierName" "modifier_frost_bite_damage_datadriven"
"Duration" "%creep_duration"
}
"FireSound"
{
"Target" "TARGET"
"EffectName" "hero_Crystal.frostbite"
}
}
"Modifiers"
{
"modifier_frost_bite_root_datadriven"
{
"IsPurgable" "1"
"EffectName" "particles/leave_bite/leave_bite_06.vpcf"
"States"
{
"MODIFIER_STATE_ROOTED" "MODIFIER_STATE_VALUE_ENABLED"
"MODIFIER_STATE_INVISIBLE" "MODIFIER_STATE_VALUE_DISABLED"
}
}
"modifier_frost_bite_damage_datadriven"
{
"IsPurgable" "1"
"IsHidden" "1"
"OnCreated"
{
"Damage"
{
"Target" "TARGET"
"Damage" "%damage_per_second"
"Type" "DAMAGE_TYPE_MAGICAL"
}
}
"ThinkInterval" "%damage_interval"
"OnIntervalThink"
{
"Damage"
{
"Target" "TARGET"
"Damage" "%damage_per_second"
"Type" "DAMAGE_TYPE_MAGICAL"
}
}
}
}'
# Print the match result
str.match(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html