Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How use RegEx to replace two or more white spaces between double quotation marks?

ups366
8 - Asteroid

Hello all !

 

I want to replace all  spaces between the  double quotes at once with regular expression, But it can't be achieved, Could you please help me? thank you !

String : 55445  fddfhgh  65hj56 7yg " 1w  fff    ffddf  " 4343rr gtr "8899tt p    9898 " in end

want to :  55445  fddfhgh  65hj56 7yg "1wfffffddf" 4343rr gtr "8899ttp9898" in end

 

so, any ideas ?

 

4 REPLIES 4
fmvizcaino
17 - Castor
17 - Castor

Hi @ups366 ,

 

I don't know how to do that with regex only because it would be a bit tricky since " 4343rr gtr " is also between quote marks and even without that, I wouldn't know how to do it hahaha

fmvizcaino_0-1590726234650.png

 

 

I'm attaching my solution here.

Best,

Fernando Vizcaino

ups366
8 - Asteroid

@fmvizcaino 

 

Dear, thank you for your reply. and if there only have a couple double quotation in string, how can use regex.replace remove all white spaces between quotation?

 

String : 55445 fddfhgh 65hj56 7yg " 1w fff ffddf " 4343rr

Want :  55445 fddfhgh 65hj56 7yg "1wfffffddf" 4343rr

 

Thank you again !

fmvizcaino
17 - Castor
17 - Castor

Hi @ups366 ,

 

If there is a way, I'm not aware of how to do it in a single expression.

https://stackoverflow.com/questions/277547/regular-expression-to-skip-character-in-capture-group

 

Best,

Fernando Vizcaino

BenMoss
ACE Emeritus
ACE Emeritus

Is there a reason why the solution proposed by @fmvizcaino is not suitable, or is it purely because it's not a one tool solution, in which case you might be waiting a while because I'm not sure how possible this is!

 

But it would be good to know if the issue goes beyond that?

 

Ben

Labels