Browse Source

Fix Regex for character names with "." & "'"

Old Regex expression did not capture Character names with "." and "'". As a result characters with names like "Mr. Jones" or "Ab'ar" were not registering correctly.

I added . & ' characters into Regex. We may need to add some more characters in future.
master
Sercan Altun 9 years ago committed by GitHub
parent
commit
00ac0647ad
  1. 2
      Assets/Fungus/Narrative/Scripts/ConversationManager.cs

2
Assets/Fungus/Narrative/Scripts/ConversationManager.cs

@ -164,7 +164,7 @@ namespace Fungus
{
//find SimpleScript say strings with portrait options
//You can test regex matches here: http://regexstorm.net/tester
var sayRegex = new Regex(@"((?<sayParams>[\w ""><]*):)?(?<text>.*)\r*(\n|$)");
var sayRegex = new Regex(@"((?<sayParams>[\w ""><.']*):)?(?<text>.*)\r*(\n|$)");
MatchCollection sayMatches = sayRegex.Matches(conv);
var items = new List<ConversationItem>(sayMatches.Count);

Loading…
Cancel
Save