Application Development and Automation 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: 
Read only

Better RegEx?

former_member194669
Active Contributor
0 Likes
379

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

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
Read only

former_member194669
Active Contributor
0 Likes
350

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


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