Alex Rivera | Logout

How to use regular expressions to match everything before a certain type of word

Asked 2009-02-17T23:48:38.803
20

I am new to regular expressions.

Is it possible to match everything before a word that meets a certain criteria:

E.g.

THIS IS A TEST - - +++ This is a test

I would like it to encounter a word that begins with an uppercase and the next character is lower case. This constitutes a proper word. I would then like to delete everything before that word.

The example above should produce: This is a test

I only want to this processing until it finds the proper word and then stop.

Any help would be appreciated.

Thanks

Edit
Report

1 Answer

0

([A-Z][a-z].+)

would match:

This is a text

answered 2009-02-17T23:58:15.270

Your Answer