Max Replace The page is generated with the help PHP - creating pattern MaxReplace
Files used at generation: replace.txt, en.txt, main.htm, top.htm, blue.htm, menu.txt, lang.txt, blue_baners.htm, baners.txt, gray.htm, datatype.htm, datatype_en.txt, buttom.htm
Time of generation: 0.0455329418182 msec
Menu
Language
Baners
Data
Given as parameters of an builder of patterns
In parameters of builder of patterns as a pattern or given it is possible to transfer both name of files, and line.
Examples
 [autopattern: /pattern_file.htm, /data_file.txt
 [autopattern: /pattern_file.htm, first line, next line

For display of the second example, in a file - pattern it is necessary in two places to specify of a marker - cycle, and if you want equally to deduce(remove) both lines, occurs duplicated HTML a code.

To avoid duplication it is possible to transfer lines as a vector of lines, as a separator of elements of a vector is used "|"
Example:
 [autopattern: / pattern_file.htm,
**ATTENTION!!! do not use points between symbols "<" and ">" .

Rules of sample
At the instruction(indication) of the name of a file as parameter of a builder of patterns it(he) is processed everything, but sometimes there is a necessity to process only part of a file.

Examples of application "-":
 [autopattern: / pattern_file.htm, /data_file.txt<0|3-5|8> Ц in this example the file "data_file.txt" will be loaded not all but only lines: 1,4,5,6,9
 [autopattern: / pattern_file.htm, /data_file.txt<-3|8> Ц line: 1,2,3,4,9
 [autopattern: / pattern_file.htm, /data_file.txt<1|100> Ц and if in a file only 10 lines that will appear lines: 2,10

Examples of application "+":
 [autopattern: / pattern_file.htm, /data_file.txt<0|3+5|8> Ц almost same, as previous examples only now file is read out from the end, from a file with 10 lines the lines will be deduced(removed) only: 1,7,6,5,9

Examples of application "%":
 [autopattern: / pattern_file.htm, /data_file.txt<0%2> Ц since the second line, everyone undertakes second a line, for a file from 10 lines, result will be lines: 1,3,5,7,9
 [autopattern: / pattern_file.htm, /data_file.txt<0%2|1> - line: 1,3,5,7,9,2

Examples of application "*":
 [autopattern: / pattern_file.htm, /data_file.txt<0*2> Ц sense same as well as in the previous example, only file begins to be read out from the end, line: 10,8,6,4,2
 [autopattern: / pattern_file.htm, /data_file.txt<1*3> - строки: 9,6,3

Examples of application "^":
 [autopattern: / pattern_file.htm, /data_file.txt<0|1^3> Ц returns a casual line in an interval from 2 up to 4 only lines: 1,2
 [autopattern: / pattern_file.htm, /data_file.txt<^> Ц returns a casual line in an interval from 1 up to the end of a file.

Rules of sample can be applied both to a file - data, and to a file - pattern.
© 2008 ZuBAR