Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Check/Xtend: Regular Expression syntax
Check/Xtend: Regular Expression syntax [message #486335] Thu, 17 September 2009 10:23 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Dear Xtend folks,

could you point me to some reference on the Syntax for regular
expressions for Strings in Xtend and Check?

I want to use e.g.

name.matches("MyRegex");

Where MyRegex is a regular expression. I tried to follow the Java Syntax
( http://java.sun.com/javase/6/docs/api/java/util/regex/Patter n.html ) like

name.matches("\w*");

to make sure that something only consists of word characters.
Unfortunately the syntax seems to be different.

Google didn't show me the way and the old oAW document also not
( http://www.openarchitectureware.org/pub/documentation/4.3.1/ html/contents/core_reference.html#r10_expressions_language
)

Cheers,
Hauke
Re: Check/Xtend: Regular Expression syntax [message #486630 is a reply to message #486335] Fri, 18 September 2009 13:16 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Unfortunately, you have to double the backslashes.

So it is :
name.matches("\\w*");

Regards,
Sven

Hauke Fuhrmann schrieb:
> Dear Xtend folks,
>
> could you point me to some reference on the Syntax for regular
> expressions for Strings in Xtend and Check?
>
> I want to use e.g.
>
> name.matches("MyRegex");
>
> Where MyRegex is a regular expression. I tried to follow the Java Syntax
> ( http://java.sun.com/javase/6/docs/api/java/util/regex/Patter n.html ) like
>
> name.matches("\w*");
>
> to make sure that something only consists of word characters.
> Unfortunately the syntax seems to be different.
>
> Google didn't show me the way and the old oAW document also not
> ( http://www.openarchitectureware.org/pub/documentation/4.3.1/ html/contents/core_reference.html#r10_expressions_language
> )
>
> Cheers,
> Hauke


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Previous Topic:how exclude object from set
Next Topic:How include objects into new set
Goto Forum:
  


Current Time: Thu Apr 25 19:38:59 GMT 2024

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

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

Back to the top