What chemical substance is in red cabbage which serves as an indicator for acids and bases?

http://chemistry.about.com/od/acidsbase1/a/red-cabbage-ph-indicator.htm

http://en.wikipedia.org/wiki/Red_cabbage

the chemical substance called flavin (an anthocyanin)

is it write?

I think both flavins and anthocyanins are classes. I don't think either article I cited gives the exact name.

The chemical substance in red cabbage that acts as an indicator for acids and bases is called anthocyanin. Anthocyanin is a water-soluble pigment that gives red cabbage its vibrant color. When red cabbage juice is mixed with an acidic solution, the pigment changes its color to red. On the other hand, when it is mixed with a basic solution, the color transitions to green or blue. This color change occurs due to the variation in the pH (acidity or alkalinity) of the solution, causing a shift in the anthocyanin molecules' structure and resulting in different absorbance of light wavelengths, therefore changing the observed color.

To extract the anthocyanin indicator from red cabbage, you can follow these steps:
1. Start by chopping up a red cabbage into small pieces.
2. Place the chopped cabbage in a heat-resistant container.
3. Add boiling water to the container, ensuring that it covers the cabbage entirely.
4. Allow the mixture to steep for about 10 minutes. The anthocyanin will be released into the water and give it a purple hue.
5. Strain the liquid from the cabbage using a sieve or cheesecloth, collecting the resulting red cabbage juice.
6. Now, you can use the red cabbage juice as an indicator to test the pH of various substances.

Remember, this natural indicator is not as precise as laboratory-grade indicators, but it can still provide a rough estimation of whether a substance is acidic or basic based on the observed color change.