Regular expression for splitting email addresses (in Java)

I am hoping that there might be an easy way to do this, I am assuming regular expressions. Whats the best way in java to split the following string into email addresses? [email protected], "Jane"...

Is this the RegEx for matching any cell reference in an Excel formula?

I have been trying to create a regular expressions pattern that matches any reference in any Excel formula, including absolute, relative, and external references. I need to return the entire...

Convert single-quoted string to double-quoted string

I want to check whether the given string is single- or double-quoted. If it is single quote I want to convert it to be double quote, else it has to be same double quote.

Do python packages (multi-file modules) behave exactly as one big module?

I've just read an article that supposedly introduced me to a new concept: Up to now I was sure that python packages (i.e directories with an __init__.py file) behave exactly the same as java...

jQuery: Setting select list 'selected' based on text, failing strangely

I have been using the following code (with jQuery v1.4.2) to set the 'selected' attribute of a select list based on its 'text' description rather than its 'value': $("#my-Select option[text=" +...

I am getting invalid sheetnames from Excel files using OleDb. What's wrong?

I try to get excel sheet names, with oledb. My connection string is: "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filepath + ";Extended Properties=Excel 12.0;"; where filepath is a...

How to escape indicator characters (i.e. : or - ) in YAML

In a config file, I have a key to which I wish to assign a URL. The problem is that YAML interprets : and - characters as either creating mappings or lists, so it has a problem with the line url:...

How to search for a value with quotation marks in sql column and replace it?

In my sql table i have a column where i have values like : I need to find these type of entries and remove single quotes as i dont need them, but how to fetch them through query in where clause...

Java - Append quotes to strings in an array and join strings in an array

I would like to append double quotes to strings in an array and then later join them as a single string (retaining the quotes). Is there any String library which does this? I have tried Apache...

YAML: Do I need quotes for strings in YAML?

I am trying to write a YAML dictionary for internationalisation of a Rails project. I am a little confused though, as in some files I see strings in double-quotes and in some without. A few points...

bash alias command with both single and double quotes

I have this command that does what I want but I can't get to alias it in my .bashrc (note that it uses both single and double quotes): svn status | awk '$1 =="M"{print $2;}' I've tried: alias...

Powershell: passing json string to curl

I'm trying to pass a JSON string from within a powershell script to the build.phonegap.com api, using curl. According to phonegap's forum, when running on a Windows machine, the JSON data has to...

PHP passing string with apostrophe to shell_exec

I’m trying to pass a string (drawn from a PDO query to an MYSQL DB) via PHP shell_exec to a *nix program, in this case xtide. All works fine until I pass a string containing an apostrophe. This...

I just assigned a variable, but echo $variable shows something else

Here are a series of cases where echo $var can show a different value than what was just assigned. This happens regardless of whether the assigned value was "double quoted", 'single quoted' or...

Powershell EncodedCommand Length Issue

I'm trying to use powershell.exe's -EncodedCommand parameter to run a powershell script as a different user. I'm doing this to avoid dealing with command line difficulties of escaping quotes and...

What's the "E" before a Postgres string?

I was reading a Postgres/PostGIS statement like this: SELECT ST_AsBinary( ST_GeomFromWKB( E'\\001\\001\\000\\000\\000\\321\\256B\\312O\\304Q\\300\\347\\030\\220\\275\\336%[email protected]', 4326 ...

ESLint unexpected character '@' for JS decorators

I'm trying to use decorators in my JS project, however ESLint is throwing an error stating that the @ symbol is a unexpected character. My code: @observable items = []; My .eslintrc: { ...

ESLint with React gives `no-unused-vars` errors

I've setup eslint & eslint-plugin-react. When I run ESLint, the linter returns no-unused-vars errors for each React component. I'm assuming it's not recognizing that I'm using JSX or React syntax....

Shell embed variable with spaces inside the string of commands

This example is based on swaks, however it's not the only program I use where this problem is doing my head in :) I have a variable SUBJECT="test subject" and then I append commands to a...

Getting "numeric argument required" when running a script with arithmetic operations

I'm trying to write a function that is supposed to convert a time stamp of the form hr:min:sec,ms (i.e 15:41:47,757) to milliseconds. The function is the following: #!/bin/sh mili () { ...

React this.setState will be queued properly?

As I checked the React setState Think of setState() as a request rather than an immediate command to update the component. For better perceived performance, React may delay it, and then update...

Error parsing parameter '--expression-attribute-values': Invalid JSON: Expecting property name enclosed in double quotes: line 1 column 3 (char 2)

I am running the following query aws dynamodb query ` --table-name user` --key-condition-expression "datecreated = :d" ` --expression-attribute-values "{ ':d': { 'S': '2018-08-15' } }"...

JSON string - include single quote in MySQL database

I have a JSON type filed in a MySQL table. But if the data value contains a single quote, it fails saying bad SQL grammar. Please find the SQL query: We can resolve this if we add escape character...

how to export hive data to csv format with double quotes in beeline HDP

I'm trying to create a csv file from hive table from beeline in HDP . The csv file should contain double quotes for all the values. I'm using below syntax beeline -u 'jdbc:hive2://hostname'...

scp fails with "protocol error: filename does not match request"

I have a script that uses SCP to pull a file from a remote Linux host on AWS. After running the same code nightly for about 6 months without issue, it started failing today with protocol error:...

RegEx for parsing CSV that contains JSON in a "column"

I need to parse a comma separated text file where a line can contain a json as column value. The file also contains a header row. I am trying to build a regular expression, so that I can parse...

How do I escape single quote / apostrophe when using Springboot Query annotation on a MongoDBRepository

I am using a MongoDBRepository interface to perform a lookup on a database. I am using the Spring @Query annotation to do the lookup but any input string which includes a single quote breaks...

Babel module resolver doesn't work as expected

I configured babel-plugin-module-resolver with eslint in my node project. This is my eslintrc. { "env": { "es6": true, "node": true }, "extends": [ "airbnb-base" ], ...

Why does copying multi-row text from Google Sheets to the Instagram caption box add a quote mark at the beginning and end of the text?

This may be the most niche question ever but let's try it anyway. I have a Google Sheets spreadsheet that contains cells with multiple lines of text. Each line of text is separated by a soft...

How do I count the letters in Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch?

How do I count the letters in Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch? print(len('Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')) Says 58 Well if it was that easy...