groovy regex for last character with no new line to search for -


i have text

customer| name|acme tools" ) &  contact|     name|john renfrew" ) &      email|john@mail.com" ) &      birthdate|getasdate( "4/6/1957" ) )  ) &  createdat|get ( currenttimestamp ) ) ) ) 

and trying regex out last " or last )

my expression

"?( +)?\)( +)?(&)?( +)?\n 

which works fine apart last line has no newline after giving:

customer| name|acme tools contact|     name|john renfrew     email|john@mail.com     birthdate|getasdate( "4/6/1957" )  createdat|get ( currenttimestamp )  ) 

any genius offer guidance , assistance??

so appears " , & optional, along surrounding whitespace. can assume ) present? if there's more one, want match last one? if so, should it:

string s1 = s0.replaceall(/(?m)"? *\\) *&? *$/, ""); 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -