Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
In MS Outlook, if I type the following in the BODY of the email
me#you.com outlook will assume this is an email address and put a mailto: around it
but if I type
that'sMyDog#you.com outlook will treat this as text. Is there a setting in outlook to escape single quotes or anything that will make a name like O'brien work the same as Obrien?
Thanks
Outlook uses angle brackets to force a URL, e.g.
<www.example.com/address containing spaces>
However even this does not seem to work for apostrophes in email addresses. What you need to do is escape the apostrophe: the hex for ' is hex 27 so it can be escaped as:
<that%27sMyDog#you.com>
If you are doing this programmatically or not, if so there should be a URL encode type function available in the language you are using that will do this for you.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
東京都building千代田区丸の内1building2floor1number
to
東京都千代田区丸の内1-2-1
PS: Digits are double bytes.I have a string,that contains address. How to convert that address like above.
Answering the question that probably should have been asked (given the clarifications in comments):
address.gsub(/([0-9]+)(?:丁目|番地?|号)(?=[0-9]|$)/, '\1-').sub(/-$/, '')
This will process any sequences of "number+location" (with "location" being lot, block, (house) number...) that is either followed by another number, or is at the end of the string, replacing the location with a dash; then removing the final dash, if there is one.
Note that this will not pick up on Japanese numbers: if you get an address like 東京都千代田区丸の内一丁目2番1号, it makes no sense to transform it to 東京都千代田区丸の内一-2-1, and converting Japanese numbers into Arabic ones is trivial up to 9 and then a bit less trivial.
string.gsub(/(?<=[0-9])(?:丁目|番地?|号)\b/, "-").sub(/\z/, "")
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I know that when emails and websites display �, something went wrong with character encoding along the way, but my understanding of exactly how encoding works is very limited - pretty much limited to knowing that (1) it makes no sense to have a string without an encoding - no such thing as "plain text," and (2) trying to merge two strings with different encodings leads to a corrupt result. But I don't really understand exactly where in the process the interpretation of the foreign character is off.
Essentially what I'm looking for is a breakdown of the process of how a foreign character that is entered into an email by a user OR a foreign character that is entered into a string in the code by the programmer ultimately gets displayed incorrectly as �. What is the original encoding? What is the outputted encoding? What happens along the way? And how should this be fixed?
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I need to use scan in particular to get the data and the data only between two values using scan and a regex expression.
The values aren't static so I can't match using them.
Let me rephrase it, i need the value only. So something that allows me to get everything after id="results" value=" and before "
id="results" value="/randompath/lol.jpg"
I got no clue what you're actually searching for but if you want to extract the value of the attribute value in that string (assuming double quotes).
You can use this regex:
(?:^|\s|")value(?:\s+)?=(?:\s+)?(?:"((?:\\.|[^"])+)")
But for sure any html/xml parser like Nokogiri would be better if you can use one.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am in a search of one regular expression which validates the following string format "1,a|2,b|3,c".
Also I want to parse this string and extract out the numbers and characters.
Can any one has any idea on what could be the best regular expression.
Thanks
Try this expression: http://regex101.com/r/qI7kW9
/(\d),([a-z])(?:\||$)/gi
The first capturing group will hold the digit, the second will hold the letter. If there will be more than one character that you want to capture, use this:
/(\d+),([a-z]+)(?:\||$)/gi
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am having a problem with utf-8 characters displaying correctly when being viewed with Notepad++.
I am viewing a list of geographic locations downloaded from:
http://www.world-gazetteer.com/wg.php?x=1322834778&men=stdl&lng=en&des=wg&srt=npan&col=adhoq&msz=1500
I have already set encoding->Encode in utf8 .
An example of a display problem is the city "H̨alīmābād". I see it as H,then a square character, then alīmābād. However if I copy and paste from Notepad++ to, say this text area, the city name shows up properly.
I've tried Googling around but most of the answers are to set the encoding to utf8 in the editor which, as I mentioned earlier, I have already done.
If anyone could suggest how to fix this issue I would very much appreciate it. Thanks much!
In your example, the first visible letter is encoded by the letter H followed by a combining ogonek; codepoint 48 followed by 328 . Your other accented letters are encoded by a single code-point, e.g. 12B for the "latin small letter I with macron".
You might care to read the unicode FAQ on Characters and Combining Marks. The question with the example of an "X with circumflex by use of X with a combining circumflex" is equivalent to your situation. You'll note that it says "Your problem is most likely a limitation of the layout engine and/or font you are using". As such, the first thing you might want to try is seeing if you are able to view the file using a different font.