Manipulate char and string regex? How override a part of a string?
in
Programming Questions
•
3 months ago
Hi processing
I work on a basic code to check if one string exist in on other.
i made one sketch working just the two strings begins with the same chars.
I know a bit regex, but not enough to solve my problem.
what i want is :
check if one string contains an other AND at which index ( how use regex to solve it? )
i want to override some specific part at one specific index of a string
i can take the example
String s = "Inside tags, you will find <tag>multiple</tag> ";
s += "<tag>pieces</tag> of <tag>content</tag>.";
String[][] m = matchAll(s, "<tag>(.*?)</tag>");
for (int i = 0; i < m.length; i++) {
println("Found '" + m[i][1] + "' inside a tag.");
}
I work on a basic code to check if one string exist in on other.
i made one sketch working just the two strings begins with the same chars.
I know a bit regex, but not enough to solve my problem.
what i want is :
check if one string contains an other AND at which index ( how use regex to solve it? )
i want to override some specific part at one specific index of a string
i can take the example
String s = "Inside tags, you will find <tag>multiple</tag> ";
s += "<tag>pieces</tag> of <tag>content</tag>.";
String[][] m = matchAll(s, "<tag>(.*?)</tag>");
for (int i = 0; i < m.length; i++) {
println("Found '" + m[i][1] + "' inside a tag.");
}
how can I delete outside from the < and > char?
I know there is a lot of questions, but i work so hard and
now i really need help.Thx!
1