Xcode Wildcard characters?

2019-06-04 05:30发布

问题:

I have a whole list of data that I need to replace some data with.

Each line starts with:

<select value="12345">

(where 12345 is different on each line)

and I want to replace it with:

@"

How do I do this, I can find the right find and replace algorithm to do this? It would really save me hours.

回答1:

You want to do this change in your source code in an Xcode project ? Or you want to write a program using Xcode to do this ?

Assuming it's the former then you can just do Edit -> Find in Project, select "Regular Expression", then the find string would be:

<select value="([0-9]+)">

and the replacement string would be:

<select value=@"\1">