CJex / regulex

:construction: Regular Expression Excited!
https://jex.im/regulex/
MIT License
5.71k stars 756 forks source link

unexpected char on pipe symbol #15

Closed jkuhnert closed 9 years ago

jkuhnert commented 9 years ago

Was presented with an unexpected char error when trying to make your awesome tool choke on this regexp pattern which I myself am not responsible for having written but nonetheless does still validly work (as a java.util.regex pattern):

(\w*?)(\s+|^)(NORTHEAST |NORTHWEST |SOUTHEAST |SOUTHWEST |NORTH |SOUTH |EAST |WEST |NE |NW |SE |SW |N |E |S |W |)\s*?((COUNTY |CNTY |CTY |STATE |ST |US |UNITED STATES |TOWNSHIP |TS |TWP |OLD |RANCH |INTERSTATE |)\s*?((?<=(?:COUNTY |STATE |ST |RANCH |CNTY |CTY |TOWNSHIP |TS |TWP |OLD |))ROAD|(?<=(?:COUNTY |STATE |ST |RANCH |CNTY |CTY |TOWNSHIP |TS |TWP |OLD ))RD|(?<= )HIGHWAY|(?<= )HIWAY|(?<= )HWY|(?<= )EXPRESSWAY|(?<!^STAR |^TRACY|^)ROUTE|(?<!(?:^STAR |^TRACY|^))RTE|rte|(?<!(?:^STAR |^TRACY|^))RT(?= )|(?<= )CR(?= )|(?<= )VIA(?= )|(?<= )INTERSTATE(?= )|(?<= )LOOP|(?<= )I(?=-\d+)|(?<= )I(?= \d+)|(?<= )I(?=\d+)))($|[-\s]*(\w?\w*)( NORTHEAST(?=$| )| NORTHWEST(?=$| )| SOUTHEAST(?=$| )| SOUTHWEST(?=$| )| NORTH(?=$| )| SOUTH(?=$| )| EAST(?=$| )| WEST(?=$| )| NE(?=$| )| NW(?=$| )| SE(?=$| )| SW(?=$| )| N(?=$| )| E(?=$| )| S(?=$| )| W(?=$| )|)\s*(.*?))
CJex commented 9 years ago

Thanks. I fixed the first problem. But sadly I found the regex contains (?<=a) ,which doesn't support by javascript and regulex currently. See: https://github.com/JexCheng/regulex/issues/16

jkuhnert commented 9 years ago

Sweet yeah, I think what you've got going here is pretty great so far either way.

P.S. You should check out http://conveyal.com/blog/2014/04/28/transitive-intro/ (https://github.com/conveyal/transitive.js) for some more ideas on styling and laying out of things, perhaps. What they've done so far is really really beautiful IMO.

liudongmiao commented 2 years ago

demo: jianyu.io/regulex/