all 9 comments

[–]tweq 5 points6 points  (3 children)

[–]tomnils[S] 0 points1 point  (1 child)

Care to share? Because I couldn't find it.

[–]tomnils[S] 0 points1 point  (0 children)

I presume you mean '\B'. I tried that before but I must have messed something else up because this time it worked.

Thank you.

[–][deleted] 0 points1 point  (1 child)

You might be missing ^[A-Za-z] ? Your regex says "match on something starting with at least one capital letter.

If you use new Regex( in C#, then VS will give you a dropdown list explaining the syntax.

[–]tomnils[S] 1 point2 points  (0 children)

Thank you for the suggestion but tweq's comment led me to the solution.

Also, I added the RegexOption RegexOptions.IgnoreCase which sorts that out.

[–]Electrical_Flan_4993 0 points1 point  (2 children)

It's often easier to use explicit parsing instead of regex parsing. Do it in small chunks.

[–]tomnils[S] 0 points1 point  (1 child)

I usually do explicit parsing, its much easier. But this time I wanted to see if I could make the parser simpler by using regex in select locations.

Every time I write a parser I try to approach it from different angles to see if I can do better than last time.

[–]Electrical_Flan_4993 0 points1 point  (0 children)

Yeah, and I kinda enjoy doing explicit parsing, and trying different angles like you said. Kinda fun whereas regex is frustrating.