Hi all!

I want to do something I think should be simple with regular expressions but I can't quite get the syntax right. I thought maybe someone else could help.

My goal is simply a find, not a find and replace.

I want to be able to find anytime there is a numeral followed by a comma and a space and then another numeral. As a separate search I want to find anytime there is a numeral followed by a space the word "and" another space and another numeral.

In short, I want to find any example of this, where "#" in these examples is any number, 0-9:

#, #

# and #

Can anyone help me out? Thanks so much!

## Simple Regular Expression question

### Re: Simple Regular Expression question

Is numeral only one digit or one or more digits?

In regular expressions \d represents one digit.

So you need go to to Batch replace tab.

Check Use Regular Expressions

Check Find Only.

then you may put into

\d, \d

and on the second line of search for:

\d and \d

if numeral means one or more digits then you need to use \d+

Thus you need to have two lines:

\d+, \d+

\d+ and \d+

In regular expressions \d represents one digit.

So you need go to to Batch replace tab.

Check Use Regular Expressions

Check Find Only.

then you may put into

**search for**:\d, \d

and on the second line of search for:

\d and \d

if numeral means one or more digits then you need to use \d+

Thus you need to have two lines:

\d+, \d+

\d+ and \d+

### Re: Simple Regular Expression question

Thanks! I'm not sure what I'm doing wrong, but that's turning up all sorts of false positives.

Should the regular expression in the batch replace should look like this for digits separated by "and" and a space on either side, or am I doing something wrong:

[\d and \d]

Thanks!

EDIT: Oops, I had the Batch Replace set to File Names only which was messing everything up. I think I'm back on track now. I'll let you know how it goes! Thanks!

Should the regular expression in the batch replace should look like this for digits separated by "and" and a space on either side, or am I doing something wrong:

[\d and \d]

Thanks!

EDIT: Oops, I had the Batch Replace set to File Names only which was messing everything up. I think I'm back on track now. I'll let you know how it goes! Thanks!