[Sidefx-houdini-list] dose anyone have any AttribStringEdit regex examples?

Robert Kelly isstuff at gmail.com
Thu Jan 23 08:36:16 EST 2014


Thanks this is the kind of stuff that should be in the documentation. I would have just done something with an attrib create and a python expression. I bet this way is much faster.

Sent from my Electric Newspaper.

Robert Kelly.

> On 23 Jan 2014, at 8:36 am, Antoine Durr <antoinedurr at gmail.com> wrote:
> 
> Hi,
>  In my text below, the <from> is the From parameter, the <to> is the To parameter.  There are admittedly some options that are missing, namely to use 'tr' (translate) instead of 's' (substitute), and the 'e' for expression on the <to> field.  But to lowercase
> 
> 
> So to lowercase everything in a string field, without the user of translate or expressions:
> 
> From: (.*)
> To: \L\1
> 
> if the tr/ (translate) option were available, you could have done:
> 
> From: [A-Z]
> To: [a-z]
> 
> or if the expression were available, you could have done:
> 
> From: (.*)
> To: lc(\1)
> 
> I had to look up the \L usage, I hadn't seen that before.  Basically lowercase \1 (a.k.a. $1) which is the contents of the first set of parentheses (.*), which says "everything".  
> 
> I'll send the two items above in as an RFE, they really should be there.
> 
> 
> 
> -- Antoine
> 
> 
>> On Jan 22, 2014, at 12:41 PM, Robert Kelly <isstuff at gmail.com> wrote:
>> 
>> It was that there is not one example of how houdini uses  the regex syntax so that I can take examples on the web, adapt them and learn from them. Mostly for the initial structure. Do you put the regex in the from or the to field? Just out of interest how would you solve the simple case of lowering the case of the strings coming into the AttribStringEdit? What do you put in each field? I choose this example because it is simple on the regex end and would be tricky for glob and then I would know the format of what parameters get what strings.
>> 
>> Sent from my Electric Newspaper.
>> 
>> Robert Kelly.
>> 
>>> On 23 Jan 2014, at 5:51 am, Antoine Durr <antoinedurr at gmail.com> wrote:
>>> 
>>> Sure it does.  Just click on the 'use regular expressions' and you'll have Perl's regex library at your fingertips.  Yes, glob-style pattern matching is 80% of what you need, but sometimes a regular expression is exactly what you need.  You can look up Perl's regex, and basically you're in:
>>> 
>>> s/<from>/<to>/
>>> 
>>> or if you turn on the 'global' button you get:
>>> 
>>> s/<from>/<to>/g
>>> 
>>> -- Antoine
>>> 
>>>> On Jan 22, 2014, at 6:23 AM, Edward Lam <edward at sidefx.com> wrote:
>>>> 
>>>> AttribStringEdit doesn't use regular expressions. It uses a glob-style pattern renaming. The help card has several examples:
>>>> http://www.sidefx.com/docs/houdini13.0/nodes/chop/rename
>>>> 
>>>> Personally, I think they're pretty good. What's lacking?
>>>> 
>>>> Best Regards,
>>>> -Edward
>>>> 
>>>>> On 21/01/2014 7:51 PM, Robert Kelly wrote:
>>>>> Hi Peeps
>>>>> 
>>>>> I just want to understand how AttribStringEdit  can be used in a deeper way
>>>>> maybe then get deeper into regex to do more complex things. I may just do
>>>>> some python editing of strings in staid, although not in regex.
>>>>> 
>>>>> is the attribute wrangle about to do anything interesting with strings?
>>>>> 
>>>>> if you have any intresting examples of the AttribStringEdit in its native
>>>>> form, I would like to see that too.
>>>>> 
>>>>> thanks
>>>>> _______________________________________________
>>>>> Sidefx-houdini-list mailing list
>>>>> Sidefx-houdini-list at sidefx.com
>>>>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>>>> 
>>>> _______________________________________________
>>>> Sidefx-houdini-list mailing list
>>>> Sidefx-houdini-list at sidefx.com
>>>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>>> 
>>> _______________________________________________
>>> Sidefx-houdini-list mailing list
>>> Sidefx-houdini-list at sidefx.com
>>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>> _______________________________________________
>> Sidefx-houdini-list mailing list
>> Sidefx-houdini-list at sidefx.com
>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> 
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list



More information about the Sidefx-houdini-list mailing list