-
Notifications
You must be signed in to change notification settings - Fork 4
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
Escape hyphens to ease conversion to Ruby? #1
Comments
I'll test and let you know. |
It seems to be fine. It isn't technically valid as hyphens do not need to be escaped. So I think I could add it. Another option, first do a replace for |
The particular statements are:
If you could change your regexes, that would be great...I could get rid of this bit of ugliness. I've also written a ruby program that uses the hash created by the awk script...like what I asked for here. It's a simple filter but demonstrates the technique. It only uses a few common gems. It should be understandable by anyone using the It detects/removes the tracker It's based on something I already had (which is much more sophisticated) so I didn't have to re-invent the wheel... |
If you have a fix for escaping the hyphens, I'd rather not escape them in JS since they don't need to be escaped there. Your sub misses a case though: So I think you'd be better off with: I will try to keep the hyphen always after the 0-9 in these patterns. Nice job removing 1x1 images. I would also remove 0x0 images as those happen sometimes too. |
You write:
OK.
OK... thanks.
Thanks for the tip...an easy fix -- change '==' to '<=' in a couple of places... |
I'm getting regex compile warnings on regexes like
Ruby issues a warning when it compiles these:
If I change the original regexes to
to escape the 'naked' dash, the regexes compile just fine. I'm pretty sure this is an artifact of JS that makes this legal but I just don't know for sure...
My question is: Are the second versions legal JS regexes?
My followup question is: Does this change alter the meanings of the original regexes?
My 2nd followup question would be: Which of the two versions are 'more correct™' ?
I'm not trying to start a JS vs Ruby flamewar here...just trying to make the awk script as robust as I can. I'm not a JS guy... So many languages...so little time...
The text was updated successfully, but these errors were encountered: