Conversation
Added ^ and $ for start and end so surplus chars cause an error Extended the numbers allowed in brackets to be 6 so (01224) is allowed Added the optional space so ext 5555 is allowed as well as ext5555 Made the whole thing case insensitive to allow for EXTENSION
This is automatically implied. Please remove this part.
Could you give me an example of a real-world number that uses that?
This is great. Thanks!
This change is not compatible with the code that ingests the patterns. Consider switching the or block to |
Removed ^ and $ Added a-z to the block Included uppercase letters for x, ext and extension to make it case insensitive for only this part
Removed ^ and $ as asked A real-world example would be someone entering their phone number as "(01224) 271234" as it's implied that the area code is common knowledge so is included in brackets. No problem Removed /.../i to comply with your code: see amended commit |
I'd prefer to allow any text, using the ranges that I showed before. It's less code, and it's more flexible, too. Could you add some tests for these new use cases? =) Thanks again. I really appreciate the effort. |
Changed ([Xx]|[Ee][Xx][Tt]|[Ee][Xx][Tt][Ee][Nn][Ss][Ii][Oo][Nn]) to be a block: [A-Za-z \:]{1,11} Added 10 test cases
Agreed - much cleaner See what you think of my latest commit |
Any update? |
This is much improved. I have not had time to pull it down and run the test suite. I've been very busy this past week. |
No problem - sorry to hassle. I'll wait until you're free to close this :) |
Please don't close it. I'll test, merge, and close as soon as I have the Author - "Programming JavaScript Applications" (O'Reilly 2012) On Tue, Aug 27, 2013 at 5:16 PM, u01jmg3 notifications@github.com wrote:
|
Yes, my intention is to wait |
Extended phone regex - see below
Looks good. |
Added ^ and $ for start and end so surplus chars cause an error
Extended the numbers allowed in brackets to be 6 so (01224) is allowed
Added the optional space so ext 5555 is allowed as well as ext5555
Made the whole thing case insensitive to allow for EXTENSION, etc