Skip to main content
added 1 character in body
Source Link

I'm struggling with the basics of query-replace-regex after reading the manual.

I'm trying to replace lots of citations formatted like this: #123213213, foo bar

to #123213213\, foo bar

the numbers vary from instance to instance and can be of any length. They always start with a #. Foo bar can be numbers or text. I always want to replace only:

, --> \,

without changing the numbers or the foo bar.

I've tried emacs' regex builder, and I'm stuck at "\#[0-9]*,\s.*\} which doesn't work because it selects too much before the bit I want. Ideally, I'm looking for an answer that explains how it works. Thanks for your help!

I'm struggling with the basics of query-replace-regex after reading the manual.

I'm trying to replace lots of citations formatted like this: #123213213, foo bar

to #123213213\, foo bar

the numbers vary from instance to instance and can be of any length. They always start with a #. Foo bar can be numbers or text. I always want to replace only:

, --> ,

without changing the numbers or the foo bar.

I've tried emacs' regex builder, and I'm stuck at "\#[0-9]*,\s.*\} which doesn't work because it selects too much before the bit I want. Ideally, I'm looking for an answer that explains how it works. Thanks for your help!

I'm struggling with the basics of query-replace-regex after reading the manual.

I'm trying to replace lots of citations formatted like this: #123213213, foo bar

to #123213213\, foo bar

the numbers vary from instance to instance and can be of any length. They always start with a #. Foo bar can be numbers or text. I always want to replace only:

, --> \,

without changing the numbers or the foo bar.

I've tried emacs' regex builder, and I'm stuck at "\#[0-9]*,\s.*\} which doesn't work because it selects too much before the bit I want. Ideally, I'm looking for an answer that explains how it works. Thanks for your help!

added 1 character in body
Source Link

I'm struggling with the basics of query-replace-regex after reading the manual.

I'm trying to replace lots of citations formatted like this: #123213213, foo bar

to #123213213\, foo bar

the numbers vary from instance to instance and can be of any length. They always start with a #. Foo bar can be numbers or text. I always want to replace only:

, --> \,

without changing the numbers or the foo bar.

I've tried emacs' regex builder, and I'm stuck at "\#[0-9]*,\s.*\} which doesn't work because it selects too much before the bit I want. Ideally, I'm looking for an answer that explains how it works. Thanks for your help!

I'm struggling with the basics of query-replace-regex after reading the manual.

I'm trying to replace lots of citations formatted like this: #123213213, foo bar

to #123213213\, foo bar

the numbers vary from instance to instance and can be of any length. They always start with a #. Foo bar can be numbers or text. I always want to replace only:

, --> \

without changing the numbers or the foo bar.

I've tried emacs' regex builder, and I'm stuck at "\#[0-9]*,\s.*\} which doesn't work because it selects too much before the bit I want. Ideally, I'm looking for an answer that explains how it works. Thanks for your help!

I'm struggling with the basics of query-replace-regex after reading the manual.

I'm trying to replace lots of citations formatted like this: #123213213, foo bar

to #123213213\, foo bar

the numbers vary from instance to instance and can be of any length. They always start with a #. Foo bar can be numbers or text. I always want to replace only:

, --> ,

without changing the numbers or the foo bar.

I've tried emacs' regex builder, and I'm stuck at "\#[0-9]*,\s.*\} which doesn't work because it selects too much before the bit I want. Ideally, I'm looking for an answer that explains how it works. Thanks for your help!

Source Link

Using query-replace-regex to partially replace

I'm struggling with the basics of query-replace-regex after reading the manual.

I'm trying to replace lots of citations formatted like this: #123213213, foo bar

to #123213213\, foo bar

the numbers vary from instance to instance and can be of any length. They always start with a #. Foo bar can be numbers or text. I always want to replace only:

, --> \

without changing the numbers or the foo bar.

I've tried emacs' regex builder, and I'm stuck at "\#[0-9]*,\s.*\} which doesn't work because it selects too much before the bit I want. Ideally, I'm looking for an answer that explains how it works. Thanks for your help!