Answer the question
In order to leave comments, you need to log in
How to replace text in a file using sed and a regular expression?
You need to replace the text in the file according to the regular expression. In PHP it works without problems.
The task is this:
Find the text by the expression
#\[0-9]+\<\/maxplayers\>#
And replace the numbers in it.
For example
55
Replace with
128
I write like this:
sed -i 's#\[0-9]+\<\/maxplayers\>#55#g' /path/to/file
Judging by the file update time, it writes something . But no change...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question