1,105,399 Community Members

how to append this javascript pattern to stringBuffer?

Member Avatar
sarthak25
Newbie Poster
4 posts since Oct 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

var pattern =/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/;

Member Avatar
JamesCherrill
... trying to help
10,387 posts since Apr 2008
Reputation Points: 2,081 [?]
Q&As Helped to Solve: 1,752 [?]
Skill Endorsements: 47 [?]
Moderator
Featured
 
0
 

You can append any String to a StringBuffer by using its append method, eg

StringBuffer sb = new StringBuffer("pattern is ");
String pattern = "/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/"; // will need to escape the \ chars as \
sb.append(pattern);

Question Answered as of 3 Months Ago by JamesCherrill
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: