Ask Your Question
0

Regex: How to find "in the face of" with or without "the"? [closed]

asked 2014-09-18 11:46:33 +0200

Prince gravatar image

How to find "in the face of" with or without "the"?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Prince
close date 2015-02-20 11:13:27.389082

1 Answer

Sort by » oldest newest most voted
0

answered 2014-09-18 14:45:21 +0200

oweng gravatar image

updated 2014-09-20 12:00:56 +0200

The usual regular expression would be: in (the )?face of. The trailing question mark indicates zero or one instances.

edit flag offensive delete link more

Comments

seems right also without the useless brackets.

karolus gravatar imagekarolus ( 2014-09-18 14:53:44 +0200 )edit

in ?(the ?)?face ?of is shorter and made more sense. Besides, your code would optionally add 2 spaces between 'face' and 'of'.

rautamiekka gravatar imagerautamiekka ( 2014-09-18 14:54:53 +0200 )edit

@karolus@rautamiekka, thanks for the clarification and corrections.

oweng gravatar imageoweng ( 2014-09-20 12:02:54 +0200 )edit

Thanks, oweng. It works. The brackets are necessary. Sorry for the late reply. I just realised why I've never gotten email notifications!

Prince gravatar imagePrince ( 2015-02-20 11:12:52 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2014-09-18 11:46:33 +0200

Seen: 58 times

Last updated: Sep 20 '14