I want my arduino mega to read from all 4 serial ports at the same time, running sequentially through each one I currently have the code running through Serial1, which works exactly as I want it to:

int RFIDResetPin = 13;


void setup()
{
  Serial.begin(9600);
  Serial1.begin(9600);
  Serial2.begin(9600);
  pinMode(RFIDResetPin, OUTPUT);
  digitalWrite(RFIDResetPin, HIGH);
  Serial.println("Arduino is ready");
}

void loop(){

  char tagString1[13];
  int index = 0;
  boolean reading1 = false;
  ///////////////////////////////////////
  //this reads from the reader installed
  //on serial1, which is pin 19
  //////////////////////////////////////
  while (Serial1.available() &gt; 0) {

    int readByte1 = Serial1.read(); //read next available byte

    if (readByte1 == 2) reading1 = true;
    if (readByte1 == 3) reading1 = false;

    if (reading1 &amp;&amp; readByte1 != 2 &amp;&amp; readByte1 != 10 &amp;&amp; readByte1 != 13) {
      tagString1[index] = readByte1;
      index++;
    }
  }
  Serial.print("Reader 1: "); //read out any unknown tag
  Serial.println(tagString1);


  clearTag(tagString1); //Clear the char of all value
  resetReader(); //reset the RFID reader
}




void resetReader() {
  ///////////////////////////////////
  //Reset the RFID reader to read again.
  ///////////////////////////////////
  digitalWrite(RFIDResetPin, LOW);
  digitalWrite(RFIDResetPin, HIGH);
  delay(150);
}

void clearTag(char one[]) {
  ///////////////////////////////////
  //clear the char array by filling with null – ASCII 0
  //Will think same tag has been read otherwise
  ///////////////////////////////////
  for (int i = 0; i &lt; strlen(one); i++) {
    one[i] = 0;
  }
}


However, I want to add serial0, 2, and 3 as well. there are 2 main questions I have
1) is it possible to have copy paste this section of the code:

    while (Serial1.available() &gt; 0) {

    int readByte1 = Serial1.read(); //read next available byte

    if (readByte1 == 2) reading1 = true;
    if (readByte1 == 3) reading1 = false;

    if (reading1 &amp;&amp; readByte1 != 2 &amp;&amp; readByte1 != 10 &amp;&amp; readByte1 != 13) {
      tagString1[index] = readByte1;
      index++;
    }
  }
  Serial.print("Reader 1: "); //read out any unknown tag
  Serial.println(tagString1);


  clearTag(tagString1); //Clear the char of all value
  resetReader(); //reset the RFID reader
}


while changing some of the variable names to connect the other serial ports? I saw something here, but don't know how to implement it, or if it even would work for me.

and 
2) since I am routing the incoming data through serial0, Is it possible to have this code working on it as well?
The Arduino already reads from the 4 serial ports at the same time. Or
at least as close to “at the same time” as possible with a single CPU:
every time a byte is received at one port, an interrupt is triggered
that reads the byte from the UART and puts it into a buffer. You can
then get it from the buffer using Serial.read().

What you now have to do is move the bytes from these buffers (which
belong to the Arduino hardware serial library) into you own buffers for
further processing. You can do this by checking the ports sequentially
and processing each one in turn. Everything will be fine as long as you
do not have blocking code in there. If you do block, then you run the
risk of having one of the library buffers overflow. The code you posted
is non-blocking, so you are fine.


  is it possible to have copy paste


You should avoid programming by copy-and-paste. It's not that it won't
work (it will), but you would be creating a maintenance nightmare.
Instead, put the code you would want to copy-paste into a function, and
call that function as many times as required. For example:



void handlePort(Stream &amp;port, const char *readerName, char *tagString)
{
    boolean reading1 = false;
    while (port.available() &gt; 0) {
        int readByte1 = port.read(); //read next available byte

        if (readByte1 == 2) reading1 = true;
        if (readByte1 == 3) reading1 = false;
        if (reading1 &amp;&amp; readByte1 != 2 &amp;&amp; readByte1 != 10 &amp;&amp; readByte1 != 13) {
            tagString[index] = readByte1;
            index++;
        }
    }
    Serial.print(readerName); //read out any unknown tag
    Serial.print(": ");
    Serial.println(tagString);

    clearTag(tagString); //Clear the char of all value
    resetReader(); //reset the RFID reader
    }
}


And you call it in loop():

handlePort(Serial1, "Reader 1", tagString1);
handlePort(Serial2, "Reader 2", tagString2);
...