How to extract a given substring based on next starting and ending values

hello, I am having difficulty extracting a varible length substring from a given string. For instance I am trying to draw out all of the nicknames in a dynamo script. for example I know that the nickname looks like nickname=“List.Clean|DanEDU”, but it can be any name. So I want to use something like in excel you would use find(nickname="*") where the * would find anything in between those characters that meet the rest of the sting. But I cant seem to find a node that does that in Dynamo. please advise. thanks!

Use String.SplitByRegularExpression from Clockwork package (or find or Replace)

1 Like

Is there a way to do this using a different starting and stopping point? Since I am trying to separate the nodes in a text file, the starting and stopping points are all the same between each node, but are different between themselves.

Also, why is this node REMOVING my regular expression from my string?

  1. Split the string the lines.
  2. String.StartsWith node to find the boolean s which begin with “nickname”
  3. Parse those lists as needed to replace/edit content.
  4. String.Join node to recreate a item.
  5. Write to a new file.

How do I split the string lines please?

String.Split node.

String is your original text.
Separator0 is a \r\n value.

I dont seem to be able to split the expression to anything.

A node to duplicate an existing function? Why?

1 Like

Wow look at you go! I guess I can just convert via your script. But just so I dont get left behind I dont know how you intend to use the Sting.Substing node. I mean it sounds great, but this is what comes to my mind: Starting index; probably easy enough if all nodes are the same up unitl “nickname”, ending length = ?? because all the names are different lengths. So how exactly do you use that?image

@jacob.small
I dont understand your used of the string.starts with either. I was able to get what looked like more promising results with String.Contains node. What exactly do you have in mind here?

Oh yeah sorry, I figured that out when I opened your other “GRAPH”. :sweat_smile: I had some trouble with it however. Please see my comments on your other post.