I am trying to extract part of a string using index numbers. When
"OEIUFHWOIEFWNFOPQWJFHQWOIHFEB..."
and I need a line from 5:10 (FHWOIE) . I found out that this is not possible with REGEX, since it returns only logical, not groups. However, I could not find the selection of the region line by line through the positions. Now I wonder if there are any?
I found out that this is partially possible through ...
BIND(REPLACE(?sequence, '^.{100}', "") AS ?sequencestrip1)
but not
BIND(REPLACE(?sequence, '^.{?start}', "") AS ?sequencestrip1)
I think this does it for everyone who is interested:
BIND(REPLACE(?sequence, "^.{"+str(?start)+"}", "") AS ?sequencestrip1)
and of course delete the area that interests you
BIND(REPLACE(?region, ".{"+str(strlen(?region)-10)+"}$", "") AS ?upstream)
source share