string-parsing

javascript, regex parse string content in curly brackets

会有一股神秘感。 提交于 2020-03-13 05:47:10
问题 i am new to regex. I am trying to parse all contents inside curly brackets in a string. I looked up this post as a reference and did exactly as one of the answers suggest, however the result is unexpected. Here is what i did var abc = "test/abcd{string1}test{string2}test" //any string var regex = /{(.+?)}/ regex.exec(abc) // i got ["{string1}", "string1"] //where i am expecting ["string1", "string2"] i think i am missing something, what am i doing wrong? update i was able to get it with /g

How to avoid triggering an ArrayIndexOutOfBoundsException while parsing empty positions in a line of CSV?

杀马特。学长 韩版系。学妹 提交于 2020-02-02 14:08:05
问题 String[] values = line.split(","); Long locId = Long.parseLong(replaceQuotes(values[0])); String country = replaceQuotes(values[1]); String region = replaceQuotes(values[2]); String city = replaceQuotes(values[3]); String postalCode = replaceQuotes(values[4]); String latitude = replaceQuotes(values[5]); String longitude = replaceQuotes(values[6]); String metroCode = replaceQuotes(values[7]); String areaCode = replaceQuotes(values[8]); //... public String replaceQuotes(String txt){ txt = txt

Capture keyboard inputs without a textbox

家住魔仙堡 提交于 2020-01-29 09:55:07
问题 I have a application that reads data from health cards and parse them for basic info like D.O.B., Health Card #, and names. Right now, I have a textbox that takes input from the card swiper and it works great, but I feel there could be a better approach for this. I want to have a keyboard listener in the background of the application that captures input from the card swiper and parse the data without the need of a textbox. I figure I'll need a loop function in the Form1_Load that actively

Capture keyboard inputs without a textbox

非 Y 不嫁゛ 提交于 2020-01-29 09:55:02
问题 I have a application that reads data from health cards and parse them for basic info like D.O.B., Health Card #, and names. Right now, I have a textbox that takes input from the card swiper and it works great, but I feel there could be a better approach for this. I want to have a keyboard listener in the background of the application that captures input from the card swiper and parse the data without the need of a textbox. I figure I'll need a loop function in the Form1_Load that actively

How to Parsing Full String and split into several String in Excel VBA?

三世轮回 提交于 2020-01-25 19:22:57
问题 I need help in Excel VBA. I have situation that i need to split into several data from a String. There is now specific delimiter, the condition is only a Keyword. The example of the Full String Data i got is like this: /*ORDER FORM*/ Name: Randy Full Address: Unknown Street 123 ABC Phone:0246854612 Order: 1x G Action Figure 1x Y Action Figure 2x Z Action Figure /*Fill Bank and Amount of Transfer*/ Bank: ABC Total: 2000 /*If you Reseller, Fill Data below*/ Sender: SenderPhone: /*Thank you for

How to Parsing Full String and split into several String in Excel VBA?

我只是一个虾纸丫 提交于 2020-01-25 19:21:07
问题 I need help in Excel VBA. I have situation that i need to split into several data from a String. There is now specific delimiter, the condition is only a Keyword. The example of the Full String Data i got is like this: /*ORDER FORM*/ Name: Randy Full Address: Unknown Street 123 ABC Phone:0246854612 Order: 1x G Action Figure 1x Y Action Figure 2x Z Action Figure /*Fill Bank and Amount of Transfer*/ Bank: ABC Total: 2000 /*If you Reseller, Fill Data below*/ Sender: SenderPhone: /*Thank you for

Convert string representation of keycode to Qt::Key (or any int) and back

别来无恙 提交于 2020-01-23 05:45:07
问题 I would like to convert a string representing a key on the keyboard to a keycode enum like Qt::Key (or anything else). Example conversions would be: "Ctrl" to Qt::Key_Control "Up" to Qt::Key_Up "a" to Qt::Key_A "5" to Qt::Key_5 As you see the above includes not just alpha numeric keys but modifiers and special keys. I'm not attached to the Qt keycode enum, but it seems that Qt has this parsing functionality in QKeySequence 's fromString static function (see this direct link): QKeySequence

Are there character collections for all international full stop punctuations?

青春壹個敷衍的年華 提交于 2020-01-22 19:41:29
问题 I am trying to parse utf-8 strings into "bite sized" segments. For example, I would like to break down a text into "sentences". Is there a comprehensive collection of characters (or regex) that correspond to end of sentences in all languages? I'm looking for something that would capture the Latin period, exclamation and interrogation marks, the Chinese and Japanese full stop, etc. Something like the above but for the equivalent of a comma would be great too. 回答1: I haven’t encountered any

Are there character collections for all international full stop punctuations?

偶尔善良 提交于 2020-01-22 19:41:04
问题 I am trying to parse utf-8 strings into "bite sized" segments. For example, I would like to break down a text into "sentences". Is there a comprehensive collection of characters (or regex) that correspond to end of sentences in all languages? I'm looking for something that would capture the Latin period, exclamation and interrogation marks, the Chinese and Japanese full stop, etc. Something like the above but for the equivalent of a comma would be great too. 回答1: I haven’t encountered any

Handle number in string PHP

不打扰是莪最后的温柔 提交于 2020-01-17 15:15:06
问题 I have a text area, it include string and number. I want to sum 3 record into a text like this I try to show you my stack, hope you can help me. Thank you! 回答1: I dont know, how to do that this would work with comma, but this code If(isset($_POST['test'])) { //test is my textarea name $total = 0; $ex = explode(' ',$_POST['test']); function total ($ex) { global $total; return $total+=$ex; } array_map('total',$ex); echo $total; } Worked well, when you write normal integer without anything (for