[thelist] How Do I Combine Two Regular Expressions into One?

Aylard JA (James) jaylard at equilon.com
Wed Aug 30 16:45:37 CDT 2000


	Okay, RegEx gurus, after tinkering with some regular expressions, I
am trying now to combine two regular expressions into a single statement. (I
like regular expressions, but I haven't mastered all of the linguistic
skills necessary to read and write them very ably.) Here are my two regular
expression statements:

function fnTrim(vStr) {
   vStr = vStr.replace(/^\s*/g,"") ;
   return vStr.replace(/\s*$/g,"") ;
}

	This provides the functionality of the VBScript Trim() function, and
then some, removing any leading or trailing whitespace characters. Can
anyone show me how to combine these two statements? Thanks.

James Aylard
jaylard at equilon.com




More information about the thelist mailing list