Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Ricardo Sala
16,212 PointsTrying to substitute "{{" in a String [ILLEGAL REPETITION]
Hey!
As described in the title, I am trying to substitute the substring "{{" from a String, but I keep having some "illegal repetition" problem.
Seems that "{" in regEx means "repetition" and I would need to say the compiler "hey, this is not a regex, is just a String!"!
how could I do that?
Thank you guys, you rock!
1 Answer
Steve Hunter
57,712 PointsHi Ricardo,
Maybe try 'escaping' the character by preceding it with a backslash, \.
Let me know how you get on - if that doesn't work, post some code and we can figure it out.
Steve.
Felix Sonnenholzer
14,654 PointsFelix Sonnenholzer
14,654 PointsCould you give an example on what exactly you want to substitute how?