I am trying to extract a part of a string by using index numbers. When having
"OEIUFHWOIEFWNFOPQWJFHQWOIHFEB..."
and I need string from 5:10 (FHWOIE)
I found out that it is not possible via REGEX as that returns only boolean and not groups. However, I did not manage to find a region selection on strings via positions. Now I am wondering if there is any?
I found out that it is partly possible via...
BIND(REPLACE(?sequence, '^.{100}', "") AS ?sequencestrip1)
but not
BIND(REPLACE(?sequence, '^.{?start}', "") AS ?sequencestrip1)
I think this does it for anyone who is interested:
BIND(REPLACE(?sequence, "^.{"+str(?start)+"}", "") AS ?sequencestrip1)
and of course to remove the area behind what you are interested in
BIND(REPLACE(?region, ".{"+str(strlen(?region)-10)+"}$", "") AS ?upstream)