Start a new topic

REQ: Placing email addresses on the F4 list

 Hi,


I think it would be useful if CT automatically placed email addresses on the F4 list. They are easy to identify and not subject to any translation or even conversion (as opposed to numbers). Therefore, they are very suitable for the list.


                                              Regards

                      

                                                  Wojciech


You can do this by adding a regular expression to the list of non-translatables:


I hope that I grabbed the right one here:


#|(\w)+(-)?(\w)*@(\w)+(-)?(\w)*\.\w+


Wojciech: I think it would be useful if CT automatically placed email addresses on the F4 list.


Don't you use insert AA? The addresses should be there.


Lenting: I hope that I grabbed the right one here


Nope.


H.


Hi,
unfortunately, it seems it doesn't work. But I'm not sure whether I'm doing it correctly. Shall I add the expression to non-translatable fragments just like any acronym?

                                                                Regards

                                                             Wojciech

 

Wojciech: Shall I add the expression...


DO NOT enter that regex anywhere. It's wrong. Any regex that doesn't catch all it's supposed to catch - not one more, not one less - is wrong.


H.


H.

Just tested it, and the regular expression works for the simple e-mail addresses (for more fancy ones, you'll need to enhance the expression):


image



Further reading:


https://groups.google.com/forum/#!topic/cafetranslators/sUW75QM0WrE

https://dl.dropboxusercontent.com/u/509643/ct-wiki/cafetran.wikidot.com/working-with-placeables.html

>Any regex that doesn't catch all it's supposed to catch - not one more, not one less - is wrong.


Striving for perfection, are we? ;)

Lenting: Striving for perfection, are we?


As always. But especially in the case of regexes, that's the only way to go. The regex you provided can easily lead to mistakes.


H.

>The regex you provided can easily lead to mistakes.


That's why we have to stay awake, don't we. And please don't exaggerate: it's just an extra input means. You press F4 and you (hopefully) see the caught (as in: recognised) e-mail address. If it's not listed, you'll have to insert it in another way. No mistakes possible, as far as I'm concerned.

Lenting: If it's not listed, you'll have to insert it in another way. No mistakes possible, as far as I'm concerned.


Now I don't really know about placeables (I don't believe in them), but I think mistakes a very well possible. When I first saw your regex, I immediately egocentrically knew it wouldn't work for one of my addresses (ending in net.id), and I tried to find similar cases (think J-C for intimi).


image


I think that if "hits" (make that misses) show up in the list of placeables, you can easily make mistakes. Addresses like that can be corrected with


image


but I have no idea how many email "structures" there are, and if the regex above meets my standards: Catch all, not one more, not one less.

And I'm not going to be bothered, because I let Igor-san do the work using inserted AA. He's pretty good at it.


H.


This Java regex is said to catch 99.99% of all e-mail addresses: (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
Hi,
thank you for giving me the regular expression but how to add it to CT? I tried to add it to non-translatebles list but to no avail.

                           Regards

                           Wojciech

 

Try adding the following:


|[^ ]+?\@[^ ]+?\.[^ ]+


It will catch basic e-mail address.

Login to post a comment