Skip to main content



      Home
Home » Modeling » Epsilon » EolString.replace & escape special chars?
EolString.replace & escape special chars? [message #579587] Wed, 26 August 2009 08:40
Eclipse UserFriend
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: Sun Jul 13 01:43:02 EDT 2025

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

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

Back to the top