Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex based literals #5

Open
dbachrach opened this issue Nov 18, 2013 · 4 comments
Open

Regex based literals #5

dbachrach opened this issue Nov 18, 2013 · 4 comments

Comments

@dbachrach
Copy link
Owner

It would be interesting to do:

PhoneNumber* num = $(555-666-7777);

This would also allow the NSUUID literal to be simplified to not require "uuid" at the end.

@hypercrypt
Copy link
Contributor

This could solve the b vs kb issue as well.

@hypercrypt
Copy link
Contributor

How would you feel about breaking the current prefix / suffix stuff?

@dbachrach
Copy link
Owner Author

Replacing it with regex? I don't think it needs to break the prefix suffix stuff. Those would still be supported:

[[OCUDLManager defaultManager] registerPrefix:@"#" forClass:[UIColor class]];
// can just be a helper which does:
[[OCUDLManager defaultManager] registerRegex:@"^#" forClass:[UIColor class]];

A better regex for UIColor would capture the # and 3-6 hex characters to be more precise, but I don't think regex has to break prefix/suffix.

@hypercrypt
Copy link
Contributor

That is true and that is what I've been working on. I think I've just come up with a solution. Going to try it now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants