Saturday, 24 August 2013

Check if string has asterisk in the beginning and the end with regex in Javascript?

Check if string has asterisk in the beginning and the end with regex in
Javascript?

I'm trying figure out if a string has an asterisk in the beginning AND the
end. For example: [asterisk]italic[asterisk]. I'm making a markdown
editor, and I'm fairly new to REGEX. I know ^ means beginning or string,
and $ means the end, I just don't know how to implement.
NOTE: I had to use [asterisk] instead of typing one because stackoverflow
will recognize it.

No comments:

Post a Comment