iOS accessibility, how to speak marks within text? - ios

There are some marks just like exclamation mark or question mark, and I found iOS escape them by default. How to speak them out?
Example: 'Tom! First name' or '? My last account'.

You can speak these words to add these marks.... just check
apostrophe ‘
open bracket [
close bracket ]
open parenthesis (
close parenthesis )
open brace {
close brace }
open angle bracket <
close angle bracket >
colon :
comma ,
dash -
ellipsis …
exclamation mark !
hyphen –
period / point / dot / full stop .
question mark ?
quote "
end quote "
begin single quote '
end single quote '
semicolon ;
Typography Result
ampersand &
asterisk *
at sign #
backslash \
forward slash /
caret ^
center dot ·
large center dot •
degree sign °
hashtag / pound sign #
percent sign %
underscore _
vertical bar |

Related

Google Sheets SUBSTITUTE formula for creating an image path

I'm using the following ARRAYFORMULA to create an image path:
=ARRAYFORMULA(
if(row(A:A)=1,"#Icon",IF(
B:B="",,SUBSTITUTE(
"../../../../../../_Assets/Icons/"& LOWER(B:B&".png"), " ", "_")
)
)
)
What it does
Adding a path before the text and replaces all spaces with an underscore '_'. Here is an example:
Name
#icon
A Tit(l)e
../../../../../../_Assets/Icons/a_tit(l)e.png
Title - Subtitle
../../../../../../_Assets/Icons/title _-_subtitle.png
Title text/string - Subtitle
../../../../../../_Assets/Icons/title_text/string _-_subtitle.png
What I want it to do
If possible, I would like to achieve the following:
Avoiding/removing characters in the list below like the forward slash / with an underscore _ (see the last row in my example above)
It allready replaces all white spaces with an underscore _ which is good. But when it sees a whitespace followed by a - and another whitespace it will output _-_ but then I want only a -
So the current table above would output the following instead:
Name
#icon
A Tit(l)e
../../../../../../_Assets/Icons/a_tit(l)e.png
Title - Subtitle
../../../../../../_Assets/Icons/title-subtitle.png
Title text/string - Subtitle
../../../../../../_Assets/Icons/title_text_string-subtitle.png
List of characters to be avoided/replaced with an underscore _:
# pound
% percent
& ampersand
{ left curly bracket
} right curly bracket
\ back slash
< left angle bracket
> right angle bracket
* asterisk
? question mark
/ forward slash
blank spaces
$ dollar sign
! exclamation point
' single quotes
" double quotes
: colon
# at sign
+ plus sign
` backtick
| pipe
= equal sign
Any help/suggestion would be much appreciated!
Put list of avoided chars into column and use REGEXREPLACE:
=ARRAYFORMULA(if(row(A:A)=1,"#Icon",IF(A:A="",,"../../../../../../_Assets/Icons/"&LOWER(REGEXREPLACE(REGEXREPLACE(A:A," - ","-"),TEXTJOIN("|\",0,D2:D23),"_")) & ".png")))
try:
=ARRAYFORMULA({"#Icon",
IF(B2:B="",,SUBSTITUTE(SUBSTITUTE(
"../../../../../../_Assets/Icons/"&LOWER(B2:B&".png"), " ", "_"), "_-_", "-", 1))})

GREP to find a sequence of characters without a closing apostrophe

I'm trying to find long quotes in the text that I'm editing so that I can apply a different style to them. I've tried this GREP:
~[.{230}(?!.~])
What I need is for the GREP to find any 230 characters preceded by a left/opening quote mark, not including any 230-character sequence including a character followed by a right/clsoing quote mark. This should then eliminate quotes of less than 230 characters from the search. My GREP finds the correct length sequence but doesn't exclude those sequences which include a right quote mark.
So I want to find this, which my GREP does:
But not this, which my GREP also finds:
Because it has a closing quote in it and is therefore what I'm classing as a short quote.
Any ideas? TIA
You can match an opening ‘ followed by 230 or more occurrences of any character except an opening or closing quotation mark.
To not match the closing quotation mark, you can assert it using a positive lookahead.
‘[^‘’]{230,}(?=’)
‘ Match ‘
[^‘’]{230,} Repeat 230+ times any char except ‘ or ’ using a negated character class
(?=’) Positive lookahead, assert ’ directly to the right
See a regex demo.
Thanks #Thefourthbird.
So what I needed was:
‘[^’]{230,}
to search for an opening apostrophe ‘ followed by anything but a closing apostrophe [^’] of 230 characters or more {230,}
Strangely, if you use InDesign's code for left ~[ and right ]~ apostrophe it doesn't work!

Why print() in Lua behaving like This?

On The Lua Interpreter
>print("This is a string
>>spread over multiline")
stdin:1: unfinished string near '"This is a'
Since we know on the Lua interpreter we can finish a statement over mulitline
For eg
>a=2
>a=a+
>>1
This works perfectly
Again:
>print([[This is a multiline
>>string]])
This is a multiline
string
This works fine!! then why display error in the first print() statement??
Read the fine Reference Manual:
3.1 – Lexical Conventions
[…]
A short literal string can be delimited by matching single or double
quotes, and can contain the following C-like escape sequences: '\a' (bell),
'\b' (backspace), '\f' (form feed), '\n' (newline), '\r' (carriage
return), '\t' (horizontal tab), '\v' (vertical tab), '\\' (backslash),
'\"' (quotation mark [double quote]), and '\'' (apostrophe [single
quote]). A backslash followed by a line break results in a newline in the
string. The escape sequence '\z' skips the following span of white-space
characters, including line breaks; it is particularly useful to break and
indent a long literal string into multiple lines without adding the newlines
and spaces into the string contents. A short literal string cannot contain
unescaped line breaks nor escapes not forming a valid escape sequence.
[…]
Literal strings can also be defined using a long format enclosed by long
brackets. We define an opening long bracket of level n as an opening
square bracket followed by n equal signs followed by another opening
square bracket. So, an opening long bracket of level 0 is written as [[,
an opening long bracket of level 1 is written as [=[, and so on. A
closing long bracket is defined similarly; for instance, a closing long
bracket of level 4 is written as ]====]. A long literal starts with an
opening long bracket of any level and ends at the first closing long
bracket of the same level. It can contain any text except a closing
bracket of the same level. Literals in this bracketed form can run for
several lines, do not interpret any escape sequences, and ignore long
brackets of any other level. Any kind of end-of-line sequence (carriage
return, newline, carriage return followed by newline, or newline followed
by carriage return) is converted to a simple newline.

Premature end of char-class

I had the regular expression for email validating following rules
The local-part of the e-mail address may use any of these ASCII characters:
Uppercase and lowercase English letters (a-z, A-Z)
Digits 0 to 9
Characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~
Character . (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively.
/^(([^<>()[\]\\.,;:\s#\"]+(\.[^<>()[\]\\.,;:\s#\"]+)*)|(\".+\"))#((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i
It is working in Javascript but in Ruby http://rubular.com/ it gives error "Premature end of char-class".
How can i resolve this?
Brackets are part of regex syntax. If you want to match a literal bracket (or any other special symbol, for that matter), escape with a backslash.
this should work :
/^(([^<>()\[\]\\.,;:\s#\"]+(\.[^<>()\[\]\\.,;:\s#\"]+)*)|(\".+\"))#((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i
You should escape opening square brackets as well as closings inside the symbol range:
# ⇓ ⇓
/^(([^<>()[\]\\.,;:\s#\"]+(\.[^<>()[\]\\.,;:\s#\"]+)*)…/
This should be:
/^(([^<>()\[\]\\.,;:\s#\"]+(\.[^<>()\[\]\\.,;:\s#\"]+)*)…/
Hope it helps.
irb(main):016:0> /[[e]/
SyntaxError: (irb):16: premature end of char-class: /[[e]/
from /ms/dist/ruby/PROJ/core/2.0.0-p195/bin/irb:12:in `<main>'
In JavaScript regular expression engine, you don't need to escape [ inside a character group []. However, you have to use \[ in Ruby regular expression.
/^(([^<>()\[\]\\.,;:\s#\"]+(\.[^<>()\[\]\\.,;:\s#\"]+)*)|(\".+\"))#((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i

IRC Message format clarification

I have this message received from an IRC server
:shiplu!shiplu#example.com PRIVMSG &channel :bot: Poor baby!\r\n
Here PRIVMSG is command. The rest part at the right is &channel :bot: Poor baby!
Now what is the last parameter? :bot: Poor baby! or Poor baby!
On the RFC2810 Section 2.3.1 It written that
nospcrlfcl = %x01-09 / %x0B-0C / %x0E-1F / %x21-39 / %x3B-FF
; any octet except NUL, CR, LF, " " and ":"
middle = nospcrlfcl *( ":" / nospcrlfcl )
trailing = *( ":" / " " / nospcrlfcl )
Now if :bot: Poor baby! is the last parameter how can it contain any colon? nospcrlfcl is defined not to contain any colon. If Poor baby! is the last parameter how can :bot: become middle?
The trailing (last) parameter is flagged with a colon and may contain spaces. Middle parameters may not contain spaces, and may not start with a colon.
So &channel is a "middle" and bot: Poor baby! (without the leading colon) is "trailing".

Resources