Regex in java and ignoring white spaces -


I want to type a regex to match on a string and Ignoring white spaces. For example, the search for 'FuBar' corresponds to 'Foo Bar'

You can strip the space in the search string and indexOf () if it is acceptable (a problem may occur if you do not have enough memory to do this).

I do not think a regex would be a good idea, but you basically have the same pattern:

  / f \ s * o \ s * o \ s * B \ s * a \ s * r /  

Which is basically the alternative white space between each character.


Comments