Ed Mozley
Ed Mozley

Reputation: 3519

Regex match string with possible spaces

I am trying to create a RegEx that will find the string

02075517[

However this string sometimes has spaces so I would need it to match

020 75517[

and

0207 5517[

and

020 7551 7[

etc.

I've tried using this site here: http://www.regexr.com/ but can't quite get there.

Thanks very much

Ed

Upvotes: 0

Views: 185

Answers (1)

k-nut
k-nut

Reputation: 3575

You can define a group to be matched. ([0-9 ]+\[) will match multiple numbers or spaces followed by a square bracket. See http://www.regexr.com/39rhh

Upvotes: 1

Related Questions