Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Better RegEx?

former_member194669
Active Contributor
0 Kudos

I want to find the "sbeed" from a string. I have written the following regex for that.

But I am in confusion which is better regex?


regex = '(?!sbeed$).*$'.

regex = '^$|^[^s].*|^s$|^s[^b].*|^sb$|^sb[^e].*|^sbe$|^sbe[^e].*|^sbee$|^sbee[^d].*|^sbeed.+'.

a®s

Edited by: a®s on Jan 26, 2009 4:36 PM

1 REPLY 1

former_member194669
Active Contributor
0 Kudos

As the following RegEx processes little bit faster than the other while doing with large strings


regex = '(?!sbeed$).*$'.