I am trying to use the “match” vex function like this:
i@mymatch = match("obj_",@myattr);
Instead of matching attributes with 10,12,13 values it matches with 1,0,2,3.
What would be the correct way to match decimals?
Thanks!
String matching
9696 6 2-
- mzigaib
- Member
- 998 posts
- Joined: April 2008
- Offline
-
- fsimerey
- Member
- 279 posts
- Joined: Dec. 2009
- Offline
See here
http://www.sidefx.com/docs/houdini13.0/vex/functions/match [sidefx.com]
*z - Match any string beginning with a, b or c and ending with z.
So, try to match 1, 0, 1(but already tested), 2, 1(tested), and 3.
I think you may try with this expression
i@mymatch = match("obj_",@myattr);
http://www.sidefx.com/docs/houdini13.0/vex/functions/match [sidefx.com]
*z - Match any string beginning with a, b or c and ending with z.
So, try to match 1, 0, 1(but already tested), 2, 1(tested), and 3.
I think you may try with this expression
i@mymatch = match("obj_",@myattr);
-
- tamte
- Member
- 9058 posts
- Joined: July 2007
- Offline
you'll need to do
obj_1
for your case, but as houdini's patterns are slightly more limited than regular expressions it may easily happen that you can't create simple pattern covering all the matches you want
so you can just use these rules
http://www.sidefx.com/docs/houdini13.0/expressions/_patterns [sidefx.com]
obj_1
for your case, but as houdini's patterns are slightly more limited than regular expressions it may easily happen that you can't create simple pattern covering all the matches you want
so you can just use these rules
http://www.sidefx.com/docs/houdini13.0/expressions/_patterns [sidefx.com]
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
-
- mzigaib
- Member
- 998 posts
- Joined: April 2008
- Offline
-
- mzigaib
- Member
- 998 posts
- Joined: April 2008
- Offline
Hi guys!
Here I am again with another question regarding matching strings in vex.
What would be in VEX the equivalent to the strreplace() expression?
I want to to change a attribute like:
$HIP/texture/mytexture.jpg to $HIP/texture/mytexture.rat
I would like to to that in a wrangle node is it possible?
Thanks!
Here I am again with another question regarding matching strings in vex.
What would be in VEX the equivalent to the strreplace() expression?
I want to to change a attribute like:
$HIP/texture/mytexture.jpg to $HIP/texture/mytexture.rat
I would like to to that in a wrangle node is it possible?
Thanks!
-
- tamte
- Member
- 9058 posts
- Joined: July 2007
- Offline
I think that's quite limited with current VEX functions, you could split() the string based on “.” to array, then replace last element with “rat” and than assemble back to string, but that feels like too much work for something that could be done easier
if however replacement of string attribute is what you are after, then have a look at AttributeStringEdit SOP, where you can even use regular expressions for substitutions
if however replacement of string attribute is what you are after, then have a look at AttributeStringEdit SOP, where you can even use regular expressions for substitutions
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
-
- mzigaib
- Member
- 998 posts
- Joined: April 2008
- Offline
-
- Quick Links