Splitting string in javascript using RegEx -
Trying to use This objective Your data appears to be of the form of the form Will be strongly enough: foo = bar, spic = span, a = bob \, fred that is, the key plus = val data, With Ram, so if the saved comma data is only , then you can use a simple form for 'key =' as part of your regexp. Capitals, then it works: i.e., split over a comma, if done after some capitals and one after the other. This will give you RegEx to split the following string:
C = US, ST = NY, O = GOOGLE, Inc. "
O = GOOGLE, INC
s = "C = US, ST = NY, O = GOOGLE, INC" s.split (/, (? = [
["C = US "," ST = NY "," O = GOOGLE, INC "]
Comments
Post a Comment