Comment on \d less efficient than [0-9]parentComments−rhizome13yUse the s/, Luke s/^\s+?(.*)\s+?$/$1/g−conroe6413yThat wouldn't work. First, it will only grab at only one whitespace character at the beginning and at the end. Second, if there was whitespace at the beginning or the end but not both, it won't match at all. "^\s* (.* ?)\s* $/$1/g" would work.−rhizome13ypoint being: get rid of the anchors in the alternation.
Comments
Use the s/, Luke
That wouldn't work. First, it will only grab at only one whitespace character at the beginning and at the end. Second, if there was whitespace at the beginning or the end but not both, it won't match at all. "^\s* (.* ?)\s* $/$1/g" would work.
point being: get rid of the anchors in the alternation.