Skip to content

Instantly share code, notes, and snippets.

View nelsonjiao's full-sized avatar

Nelson Jiao nelsonjiao

  • Dell EMC
  • Hopkinton, MA
View GitHub Profile
@nelsonjiao
nelsonjiao / stripTags.groovy
Created June 26, 2017 06:11 — forked from atbradley/stripTags.groovy
Very simplistically remove HTML tags from strings.
public static String stripTags(String input) {
return input.replaceAll("\\<.*?>","");
}
@nelsonjiao
nelsonjiao / re.py
Created March 27, 2017 05:51 — forked from dervn/re.py
Python中过滤HTML标签的函数
#用正则简单过滤html的<>标签
import re
str = "<img /><a>srcd</a>hello</br><br/>"
str = re.sub(r'</?\w+[^>]*>','',str)
print str
@nelsonjiao
nelsonjiao / FdGs-1.py
Created February 9, 2017 08:21
null created by nelsonjiao - https://repl.it/FdGs/1
# Define a procedure, measure_udacity,
# that takes as its input a list of strings,
# and returns a number that is a count
# of the number of elements in the input
# list that start with the uppercase
# letter 'U'.
def measure_udacity(p):
result = 0
@nelsonjiao
nelsonjiao / FdGs-0.py
Created February 9, 2017 07:47
null created by nelsonjiao - https://repl.it/FdGs/0
# Define a procedure, sum_list,
# that takes as its input a
# list of numbers, and returns
# the sum of all the elements in
# the input list.
def sum_list(p):
result = 0
for i in p: