Problems with Regular Expression

Asked

Viewed 47 times

1

I have the following beginning of Function sql I will use for a recreation system procedures/Function in C#

Create Function dbo.JN_FN_DataAtual(@TESTE INT)

And created the regular expression

(?si)\bCREATE\s*\bFUNCTION?\s*(?<owner>\w*.\b)(?<function>.*?\W)

However returned the following results:

1-dbo.

2- Jn_fn_current date(

It worked, but it did not remove the point "." nor the parentheses "(".

What can it be?

  • Specify the programming language since regular expressions can be quite different between them. Also specify better what the regular expression goal is, what you want to extract from the text.

  • amended text!

1 answer

2


If the goal is to extract the bank name and the name of the database, this would be simpler:

Create Function ([^.]+)\.([^\(]+)

A good site to test regular expressions is this: http://www.regexr.com/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.