Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Regular-expressions/Jsish/regular-expressions.jsish
Normal file
10
Task/Regular-expressions/Jsish/regular-expressions.jsish
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/* Regular expressions, in Jsish */
|
||||
|
||||
var re = /s[ai]mple/;
|
||||
var sentence = 'This is a sample sentence';
|
||||
|
||||
var matches = sentence.match(re);
|
||||
if (matches.length > 0) printf('%s found in "%s" using %q\n', matches[0], sentence, re);
|
||||
|
||||
var replaced = sentence.replace(re, "different");
|
||||
printf("replaced sentence is: %s\n", replaced);
|
||||
Loading…
Add table
Add a link
Reference in a new issue