0

I want to find and replace following

rice', ' 36,650', 'https://s
va', ' 3,650', 'https://s
rat', ' 332,650', 'https://s
fe', ' 34,650', 'https://s
rfce', ' 13,650', 'https://s
aace', ' 53,650', 'https://s 

to

rice', '36650', 'https://s
va', '3650', 'https://s
rat', '332650', 'https://s
fe', '34,650', 'https://s
rfce', '13650', 'https://s
aace', '53650', 'https://s 

Removing one comma and space from the start of digit

Update

It is not working with this one

(9, 'M-MG1', 'httion', 'Buyice', ' 3,650', 'https://', 4, 'February 22, 2016', 0, 0, 0, 0, 0, 1),

2 Answers 2

1

Search ' (\d+),(\d+)', replace by '\1\2'.

Explanation :

  • \d is a digit
  • \d+ is one or more digits. It will match as many digits as it can.
  • (\d+) is a group containing one or more digits
  • \1 and \2 are back-references : they reference the previously defined groups
Sign up to request clarification or add additional context in comments.

4 Comments

I just tried it and it worked. Did you select the regex search mode?
It is working with the above example but not with this (Updated Question)
it's still working for me, the ' 3,650' is changed into '3650'
If it helps, here's an illustration of the code in regex101 : regex101.com/r/lP6hJ0/1
0

You can try this replace : ' ([0-9]+),([0-9]+)' with \1\2

6 Comments

the space does not appear in your answer. Maybe is it because it's a the start of your code inline block? You can use &nbsp instead of space to fix that.
What space are you talking about @Aaron ?
The one mentionned in the question, that OP wants to remove
It help and solved my problem I used '\s([0-9]+),([0-9]+)' to remove the space
Yeah thanks well &nbsp didn't work I tried ' ([0-9]+),([0-9]+)' and it worked '\s([0-9]+),([0-9]+)' is working as well :).
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.