I’m wondering how I can use javascript regex to match a word like:
Name:
with all variations of spaces ? This is where I’m getting stuck. i.e.
Name<space>: FredName:<space>FredorName<space>:<space>Fred
Note the positioning of the spaces after the name, after the colon etc ?
I was hoping something like /(name(\s*:\s*)?)\w/g would work but it doesn’t 🙁
Name starts with a capital letter. The regex should also match name starting with a capital N.
iflag at the end.The
*means 0 or more. The?is not needed anymore.Something like this should work