History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-437
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Doug H
Reporter: Doug H
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

allow curly braces in regex literals

Created: 11/Aug/05 09:11 PM   Updated: 24/Aug/05 11:26 PM
Component/s: Parser
Affects Version/s: 0.5.6
Fix Version/s: 0.6

Time Tracking:
Not Specified


 Description  « Hide
Add '{' and '}' to the RE_ESC rule in boo.g and booel.g to allow the use of curly braces in regex literals like so:

s = """stuff { { code } } omg { more } pwn"""

mc = /(?<Unable to render embedded object: File (\\){(\\\{) not found.\\){.*(?<Unable to render embedded object: File (\\)})*(?<) not found.
)}/.Matches(s)

for i in range(mc.Count):
print mc[i].Value



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Doug H - 11/Aug/05 09:15 PM
Actually I noticed the pattern works if you don't escape the curly braces and use @:
mc = @/(?<Unable to render embedded object: File (\\){(\\{|\\}) not found.\\){.*(?<!\\)})*(?<!
)}/.Matches(s)

but if you do make these little additions to boo.g and booel.g, both forms work (escape and non-escaped curly braces)


Rodrigo B. de Oliveira - 16/Aug/05 09:13 AM
Thanks!