I am trying to break a string using strsplit(str, '[,-\\+]'), which means that anyone ',', '-' or '+'can be a delimiter. However, I found that this model also matches numbers and capital letters. Try
strsplit(str, '[,-\\+]')
',', '-' or '+'
grep('[,-\\]', 'X'), returns 1
grep('[,-\\]', '46'), returns 1
grep('[,-\\]', '-'), returns 1
grep('[,-\\]', ','), returns 1
It seems to '[,-\\]'match all numbers, in capital letters, ','and '-'.
'[,-\\]'
','
'-'
I just don’t understand why this is so.
Thanks for any input.
You need to use
strsplit(str, '[,+-]')
to divide by , +or -. If you need to add \for separation, use the '[,\\+-]'default TRE with the regex mechanism.
,
+
-
\
'[,\\+-]'
- ( , ) , . , '[,-\\]' , \:
, TRE ( perl=TRUE), . "[,-\\]" , PCRE , 4 .
perl=TRUE
"[,-\\]"
Source: https://habr.com/ru/post/1682760/More articles:Angular material slider change event not working - angularLaravel morphToMany in cascade mode - phpBorder color transparency works on table rows - htmlKubernetes: setting up a custom infuxdb receiver to work with heapster in the kube-system namespace on GKE - google-container-enginewhy the simultaneous modification of the foreach method, but not for the loop - javaMySql EntityFrameworkCore System.TypeLoadException - mysqlCodesign returns an unknown error after "replacing an existing signature" - iosCodesign returns an unknown error -1 = ffffffffffffffffff - iosCodesign Error - SecKey API returned: -67671 - iosНе удается запустить проект Xcode на устройстве из-за проблем с сертификатами - iosAll Articles