hyphen

IIS7 URL Rerwrite - how to replace all underscores with hyphens in a Regex?

大城市里の小女人 提交于 2019-12-10 19:48:34
问题 I am using the URL Rewrite feature in IIS7 to turn the URL: /main.asp?category=Name_Of_A_Product Into: /category/name-of-a-product/ I have created the redirect & rewrite rules below which do the majority of the work, except I cannot find a way of replacing the underscores with hyphens. Each URL can have between zero and many underscores and I'm trying to replace them in a single regular expression, to avoid chains of 301 redirects (as I believe that is bad for SEO). Do you know how (or if)

CSS hyphen throws error (invalid property value)

可紊 提交于 2019-12-10 15:48:06
问题 I want to break a text whit hyphenation, but it brings an error: It says: "Invlaid property value". But in many docs they say, that the "auto" value exists! It should break this text whit hyphenation: I hope, that someone can help me whit that! 回答1: To add to their answers to check if you have the right browser at https://caniuse.com/#feat=css-hyphens You can also check MDN's documentation about it and see how your language dictionary may not be supported yet. (scroll to the bottom to see

Replace all hyphen types by the ascii hyphen “-”

淺唱寂寞╮ 提交于 2019-12-10 14:54:16
问题 Is there a way to replace all types of hyphens by the simple ascii "-"? I am looking for something like this that works for spaces: txt = re.sub(r'[\s]+',' ',txt) I believe that some non-ascii "-" hyphens are avoiding the correct process of removing some specific stopwords (name of projects that are connected by hyphens): I want to replace this AR–L1003' for instance by AR-L1003, but I want to do this for the entire text. 回答1: You can just list those hyphens in a class. Here is one possible

Any way to disable the “minus hack” in PDF/Poscript output?

最后都变了- 提交于 2019-12-10 13:26:20
问题 In R, when saving a plot to a PDF or Postscript file, hyphens in axis labels get turned into minus signs. This, apparently, is by design. According to the documentation for the "postscript" device: There is an exception [to the normal encoding rules]. Character 45 (‘"-"’) is always set as minus (its value in Adobe ISOLatin1) even though it is hyphen in the other encodings. Hyphen is available as character 173 (octal 0255) in all the Latin encodings, Cyrillic and Greek. (This can be entered as

Python Regex for hyphenated words

試著忘記壹切 提交于 2019-12-06 20:22:24
问题 I'm looking for a regex to match hyphenated words in python. The closest I've managed to get is: '\w+-\w+[-w+]*' text = "one-hundered-and-three- some text foo-bar some--text" hyphenated = re.findall(r'\w+-\w+[-\w+]*',text) which returns list ['one-hundered-and-three-', 'foo-bar']. This is almost perfect except for the trailing hyphen after 'three'. I only want the additional hyphen if followed by a 'word'. i.e. instead of the '[-\w+]*' I need something like '(-\w+)*' which I thought would

Orthographic hyphenation word in IOS

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 06:00:37
问题 Is there a way of orthographic hyphenation word? Something like this: NSStiring *string = @"In June 2010 at the World Wide Developers Conference, Apple announced version 4 of Xcode during the Developer Tools State of the Union address."; UILabel *label = [[UILabel alloc] init]; label.text = string; And if frame UILabel will be narrow, get next: In June 2010 at the World Wide Developers Con- ference, Apple announced ver- sion 4 of Xcode during the Devel- oper Tools State of the Union ad- dress

Java case insensitive localized ordering

坚强是说给别人听的谎言 提交于 2019-12-05 18:30:48
I have set of hyphenated string sets. That I want to sort considering the locale. List<String> words = Arrays.asList("App - Small", "Apple", "App - Big"); Collator collator = Collator.getInstance(new Locale("en")); // Sort Method 1 Collections.sort(words, String.CASE_INSENSITIVE_ORDER); System.out.println(words.toString()); // Sort Method 2 collator.setStrength(Collator.PRIMARY); Collections.sort(words, collator); System.out.println(words.toString()); Result String.CASE_INSENSITIVE_ORDER [App - Big, App - Small, Apple] Collator.PRIMARY [App - Big, Apple, App - Small] Though the Collator

Can hyphens be used in query string values?

大兔子大兔子 提交于 2019-12-05 17:54:09
问题 My question is related to this one. except that my question is more sepcific as it is about whether a hyphen can be used in a query string parameter value. I am parsing $_SERVER['QUERY_STRING'] with PHP. I would like to know whether it is syntactically correct to use hyphens in query string values such as in the following case, or whether hyphens must be escaped in the browser URL. What about underscores? http://example.com/?q1=query-string-value-one&q2=query-string-value-two According to

Python Regex for hyphenated words

怎甘沉沦 提交于 2019-12-05 02:29:39
I'm looking for a regex to match hyphenated words in python. The closest I've managed to get is: '\w+-\w+[-w+]*' text = "one-hundered-and-three- some text foo-bar some--text" hyphenated = re.findall(r'\w+-\w+[-\w+]*',text) which returns list ['one-hundered-and-three-', 'foo-bar']. This is almost perfect except for the trailing hyphen after 'three'. I only want the additional hyphen if followed by a 'word'. i.e. instead of the '[-\w+]*' I need something like '(-\w+)*' which I thought would work, but doesn't (it returns ['-three, '']). i.e. something that matches |word followed by hyphen

Python regex expression to remove hyphens between lowercase characters

冷暖自知 提交于 2019-12-04 07:27:12
问题 I need to remove the hyphens between lowercase letters only. This is the expression that I have currently: re.sub('\[a-z]-\[a-z]', "", 'hyphen-ated Asia-Pacific 11-12') I want it to return: 'hyphenated Asia-Pacific 11-12' 回答1: Two approaches including some timing: import re, timeit def a1(): s = re.sub(r'([a-z])-([a-z])', r'\1\2', "hyphen-ated Asia-Pacific 11-12") def a2(): s = re.sub(r'(?<=[a-z])-(?=[a-z])', '', "hyphen-ated Asia-Pacific 11-12") print(timeit.timeit(a1, number = 10**5)) print