Facebook Twitter Gplus RSS
Home Javascript Tips:javascript regular expressions methods and usage
formats

Tips:javascript regular expressions methods and usage

Published on November 17, 2012, by in Javascript.

Now you know that the RegExp is one helpful tool for you to match,replace and test strings,i learned that from ‘正则表达式30分钟入门教程‘, a very simple tutorial.
I will not tell that i can use it at my will, but To gain anything from them you still have to know the methods and usage of regular expressions.

1.RegExp.exec(string)

2.RegExp.test(string)

3.String.match(pattern)

4.String.search(pattern)

5.String.replace(pattern,string)

6.String.split(pattern)

In the examples, you will find some through methods belonging to the String object, some through methods belonging to the RegExp object, whether the regular expression is declared through an object constructor or a literal makes no difference as to the usage.

2 Responses

  1. I’m gone to inform my little brother, that he should also visit this blog on regular basis to take updated from newest reports.

  2. I truly didn’t expect to see a post like Tips:javascript regular expressions methods and usage today. Very impressive. Reminds me of something I found out about wireless credit card service the other day.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>