in reply to Using a regex search pattern

while ( $file =~/<BOXIND\s+NUM\s*=\s*"(\d+)"\s+ID\s*=\s*"([\w\.]+)"\s* +\/>/ig) { push(@ind,$2); }

The dot+ matches as much as possible.
\s+ means there must be at least one whitespace char (tab, space, carriage return).
\s* means there might be whitespace.
the part [\w\.]+ means match at least one character comprising of any "word character" (a-z caps and lower, 0-9 and _) and the dot. If the ID contained a parenthesis, an ampersand, the match would fail.

Look into lookahead and lookbehind too..

( and .* means "how hard can i make life for myself") :)