How to insert comma as superscript in google spreadsheet - google-sheets

I want to add comma in spread sheet as a superscript like :
in this ->> ¹,²
comma is not as superscript. Is there any way out for comma to be added as superscript in google spreadsheet?
For 1 and 2 and many others, there is a function available in sheet like =char(178)
however I am ot able to find the code for comma.

Answer:
As there is no Unicode for a superscript comma, you can not do this.
More Information:
Not all characters have superscript-versions set in unicode. You can see the full list of available superscript characters here.
You can either use the dot operator (U+2265) ⋅, or the modifier letter apostrophe (U+02BC) ʼ as separators instead, if you wish to hard code this. I am of the personal opintion that the dot operator looks more like a comma, but they both appear as below:
¹⋅² (dot operator)
¹ʼ² (modifier letter apostrophe)
As Google Sheets isn't a word processing application, there is no direct in-built way to make text appear as superscript, akin to <sup>1,2</sup> in HTML:
1,2
References:
Unicode subscripts and superscripts - Wikipedia

Related

How can I remove easly Shortcodes inside a Google Sheet?

I am tryng to get rid of shortcodes inside a Google Sheet column. I have many items such as [spacer type="1" height="20"][spacer] or [FinalTilesGallery id="37"] I just would like to cancel them. Is there any simple way to do it?
Thanks !
For in-place replacement, the quick option would be to use the Find and Replace dialog (Ctrl + H) with Search Using Regular Expressions turned on, which is more powerful than your standard Find and Replace.
Find: \[.*?\] - Match anything within an open-bracket up to the very next close-bracket. This should work assuming you have no nested brackets, e.g. [[no][no]].
If you do have nested brackets, you'll have to change this to \[[^\[\]]*\]. And continue to Replace All until all the codes are gone.
Replace: Nothing.
Replace All. If you don't want to affect other sheets that may be in your document, make sure you select the right range to work with, too.
This just erases everything within the brackets.
If you want to erase any redundant spaces left by this, simply Find and Replace again (with Regular Expressions) on + (space and plus), which will match 1 or more spaces and replace with (single space).
E.g.:
string [] [] string2 -> string string2 after the shortcode replacement.
After replacing spaces, it will become string string2.
Let's say your original strings are in the range A2:A. Place the following into B2 of an otherwise completely empty Column B (or the second cell of any other empty column):
=ArrayFormula(IF(A2:A="",,TRIM(REGEXREPLACE(A2:A,"\[[^\[\]]+\]",""))))
I can't see your data, so I don't know what kind of information is between these shortcodes. If you find that this leaves you with concatenated pieces of data where there should be spaces between them, replace the above with this version:
=ArrayFormula(IF(A2:A="",,TRIM(REGEXREPLACE(SUBSTITUTE(SUBSTITUTE(A2:A,"["," ["),"]","] "),"\[[^\[\]]+\]",""))))
I can't teach regular expression language here. But I will note that, since square brackets have specific meaning within regex, your literal square brackets must be indicated with the escape character: the backslash.
Here is the regex expression alone:
\[[^\[\]]+\]
The opening \[ and the closing \], then, reference your actual opening and closing bracket sets. If we remove those, we have this left:
[^\[\]]+
Again, you see the escaped opening and closing square brackets, which I'll replace with the word these:
[^these]+
What remains there are opening and closing brackets with regex meaning, i.e., "anything in this group." And the circumflex symbol ^ as the first character within this set of square brackets means "anything except." The + symbol means "in any string length of one or more characters."
So that whole regex expression then reads: "A literal open square bracket, followed by one or more characters that are anything except square brackets, ending with a literal closing square bracket."
And we are REGEXREPLACE-ing any instance of that with "" (i.e., nothing).

How to split text using numbers as a delimiter in Google Sheets using a formula

I know how to split text using other delimiters such as a comma, equal sign etc. I am having trouble for examples that require a number delimiter.
A typical split formula that uses a comma delimiter would look like this:
=SPLIT(A1, ",")
I am struggling with splitting text that looks something like this. The delimiter here is a number.
This is a random text of 20 characters but could be 30 characters as well.
Output should be
This is a random text of | 20 | characters but could be | 30 | characters as well.
Please help. Thanks
Try the following:
=SPLIT(REGEXREPLACE(A1,"\d+","|$0|"),"|")
Maybe better, to remove spaces:
=SPLIT(REGEXREPLACE(A1,"\s*(\d+)\s*","|$1|"),"|")

How to delete all words that contain apostrophes in Sublime Text 3

I have a word list of over 10,000 words, but this is just a sample:
'Tis midnight
sev'n words spoke
th'Immortal night
A wonder-working pow'r
Wondrous deliv'rer to me
I want to delete all words that contain apostrophes so the list should look like this:
midnight
words spoke
night
A wonder-working
Wondrous to me
How can I do this using Sublime Text so it finds apostrophes and smart apostrophes (’)?
You could use a character class['’] to match both variations of the apostrophes and match zero or more times a non-whitespace character \S* before or after the matched apostrophe followed by optional horizontal white-space chars.
\S*['’]\S*\h*
Regex demo
A slightly more optimized version without preventing the first \S* causing backtracking could be using a negated character class [^\s'’]* to match until the first apostrophe.
[^\s'’]*['’]\S*\h*
Regex demo

Rails 5 - regex - for string not found [duplicate]

I have following regex handy to match all the lines containing console.log() or alert() function in any javascript file opened in the editor supporting PCRE.
^.*\b(console\.log|alert)\b.*$
But I encounter many files containing window.alert() lines for alerting important messages, I don't want to remove/replace them.
So the question how to regex-match (single line regex without need to run frequently) all the lines containing console.log() and alert() but not containing word window. Also how to escape round brackets(parenthesis) which are unescapable by \, to make them part of string literal ?
I tried following regex but in vain:
^.*\b(console\.log|alert)((?!window).)*\b.*$
You should use a negative lookhead, like this:
^(?!.*window\.).*\b(console\.log|alert)\b.*$
The negative lookhead will assert that it is impossible to match if the string window. is present.
Regex Demo
As for the parenthesis, you can escape them with backslashes, but because you have a word boundary character, it will not match if you put the escaped parenthesis, because they are not word characters.
The metacharacter \b is an anchor like the caret and the dollar sign.
It matches at a position that is called a "word boundary". This match
is zero-length.
There are three different positions that qualify as word boundaries:
Before the first character in the string, if the first character is a
word character.
After the last character in the string, if the last
character is a word character.
Between two characters in the string,
where one is a word character and the other is not a word character.

Prawn PDF number_with_delimiter number_to_currency? [duplicate]

As you can see from the title, I would like to write a regular expression pattern to find a string that consists of various numbers and is separated by comma every three digits. The length of string can vary.
I am still pretty new to regular expression thingy so can anyone help me with that? Thanks a lot in advance.
P.S.
Anyone could also suggest some of good resources, like website, books, etc, for learning regular expression?
This regex shall match that:
\d{1,3}(?:,\d{3})*
If you want to exclude match to a substring of an ill-formed pattern, you might want to do:
(?:\A|[^,\d])(\d{1,3}(?:,\d{3})*)(?:\z|[^,\d])
Explanation of the first regex
\d{1,3} 1 to 3 consecutive numerals
,\d{3} A comma followed by 3 consecutive numerals
(?:,\d{3})* Zero or more repetition of a non-capturing group of a comma followed by 3 consecutive numerals
Explanation of the second regex
(?:\A|[^,\d]) A non-capturing group of either the beginning of the string, or anything other than comma or numeral
(\d{1,3}(?:,\d{3})*) A capturing group of 1 to 3 consecutive numerals followed by zero or more repetition of a non-capturing group of a comma followed by 3 consecutive numerals
(?:\z|[^,\d]) A non-capturing group of either the end of the string, or anything other than comma of numeral
Try http://regexlib.com for good examples and links to tools to help you get up to speed with RegEx
Also try this regex tester app http://www.ultrapico.com/Expresso.htm
And another tool I've used before here http://osherove.com/tools

Resources