Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] regular expression
[ATL] regular expression [message #103597] Thu, 16 April 2009 09:54 Go to next message
Eclipse UserFriend
Hello,

I am trying to modfiy the name of the models during the model
transformations. Particularly, I want the following:

The string : "testAction_Event" should be transformed to "testAction",
so everything after the underscore should be ignored.

I tried this:

s.name->regexReplaceAll('[w_w]','[w&&^[_w]]') but the result is
"testAction[w&&^[_w]]Event"


What am I doing wrong ?


Regards,


Deepak
Re: [ATL] regular expression [message #103615 is a reply to message #103597] Thu, 16 April 2009 18:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
according to the user guide the second parameter is a replacement string
and no regular expression.
http://wiki.eclipse.org/ATL/User_Guide#String_data_type_oper ations

Since the Java RegEx syntax is used, this should do the trick:
s.name->regexReplaceAll('_.*','')

Greetings,
Max
Re: [ATL] regular expression [message #103740 is a reply to message #103615] Fri, 17 April 2009 06:55 Go to previous message
Eclipse UserFriend
Thanks Max !

That's exactly what I want.

Regards,

Deepak


Max Bureck schrieb:
> Hi,
> according to the user guide the second parameter is a replacement string
> and no regular expression.
> http://wiki.eclipse.org/ATL/User_Guide#String_data_type_oper ations
>
> Since the Java RegEx syntax is used, this should do the trick:
> s.name->regexReplaceAll('_.*','')
>
> Greetings,
> Max
>
Previous Topic:Headless configurations
Next Topic:[ATL] using static profile
Goto Forum:
  


Current Time: Tue Jul 22 13:11:35 EDT 2025

Powered by FUDForum. Page generated in 0.05311 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top