2

I have a list which consists of (goes up to 9):

 1.
 2.
 3.

And i want to make them:

1.
2.
3.

But, they all have a space before the number, I haven't found a regex to find all these occurrences, but not sure what to replace with:

 / [0-9]+\./gm

1 Answer 1

4

Use

  • \s(\d\.) in the 'Find what' field. \s is the space and (\d\.) defines an expression made up of a digit and a full stop
  • and $1 in the 'Change to' field. this removes the space and keeps the previously defined expression

enter image description here

3
  • Brilliant! What does $1 signify?
    – lanes123
    Apr 17, 2018 at 13:16
  • Edited with some more details.
    – Lucian
    Apr 17, 2018 at 13:20
  • minor expansion/clarification: ( and ) are the group delimiters, and there can be multiple groups defined, referenced by order of appearance ($1, $2, $3, . . . )
    – Yorik
    Apr 17, 2018 at 13:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.