Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
string match regex help
kai_liu589
Member, Developers Posts: 5 ✭
I have a string like this:
I then tried with a simple case:
p.s. I don't want to upload a csv file to do this.
</code>"ALine,-93980000000,0,93980000000,0////AArc,0,0,93980000000,93980000000,0,-93980000000,0"</pre></span><span>I want to first split it by "////". Then split the resulting two groups by comma. I tried to use string match to accomplish this but it doesn't return any matches.<br></span><pre class="CodeBlock"><code>println(match("ALine,-93980000000,0,93980000000,0////AArc,0,0,93980000000,93980000000,0,-93980000000,0", "[^(////)]+"));
I then tried with a simple case:
<div>println(match("a~~aa~a", "a."));
<span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Flama, sans-serif;">{ captures : [] , hasMatch : false } </span>
</div>
println(replace("a~~aa~a", "a.", "X"));<span><br>X~X~a</span>
For the same regex, the replace works by the match doesn't. What did I miss on using the match function?p.s. I don't want to upload a csv file to do this.
0
Comments
Something like this might help, though it's not going to be too fast:
We'll expose more string processing functions in time.