Written by
in
เขียน JavaScript กับข้อมูลที่ sensitive โดยใช้ RegExp เพื่อแสดงบางส่วน เนื่องจากทางผู้เขียนได้รับ requirement ให้ปรับปรุงข้อมูลที่อ่อนไหว ให้แสดงบางส่วน อย่างเช่น เลขบัตรประชาชน
โดยก่อนอื่นจะอธิบายความหมายสัญลักษณ์ RegExp ตัวอย่างเช่น
/./
จากนั้นใช้ function replace()
replace()
Note: To replace all matches, use a regular expression with a /g flag (global match)
/g
หวังว่า km จะมีประโยชน์ไม่มากก็น้อยนะคะ ที่มา https://www.w3schools.com/jsref/jsref_obj_regexp.asp
หวังว่า km จะมีประโยชน์ไม่มากก็น้อยนะคะ
ที่มา https://www.w3schools.com/jsref/jsref_obj_regexp.asp
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Δ
Leave a Reply