Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] regular expression
[ATL] regular expression [message #103597] Thu, 16 April 2009 13: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 22:19 Go to previous messageGo to next message
Max Bureck is currently offline Max BureckFriend
Messages: 72
Registered: July 2009
Member
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 10: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: Sat Apr 20 03:10:06 GMT 2024

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

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

Back to the top