Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EolString.replace & escape special chars?
EolString.replace & escape special chars? [message #579587] Wed, 26 August 2009 12:40
Darren  is currently offline Darren Friend
Messages: 40
Registered: September 2009
Member
I believe I am correct in saying that the source string of the replace
operation is a regular expression. As such can anyone explain what I am
doing wrong here:

I have a string say "children.1children.2children.1" and I want to convert
it to "c1c2c1". I wrote simply:

t := s.replace('children\.','c');

\ as . is special regex character.

However I get an problems shown in the in window (preventing a build)
saying "no viable alternative at input".

I tried below and it does not work as I assume the regex is wrong
t := s.replace('children\\.','c');

t := s.replace('children','c'); works but I want to remove the . as well


Anyone have ideas?

Thanks,

Darren
Previous Topic:EGL + Tomcat? (egl.servlet)
Next Topic:EGL + Tomcat? (egl.servlet)
Goto Forum:
  


Current Time: Fri Apr 26 01:39:16 GMT 2024

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

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

Back to the top