Re: Regex help



Hello Epetruk,

Hello,

I'm trying to write a regular expression that extracts the host name
from a string.

In other words, the string I extract must have:

- only letters, numbers and fullstops in it;

- the fullstops most be in the middle of it.

So if I have a string like this:

"this is a host.domain.com name that I want"

what kind of regular expression would I write to extract
'host.domain.name'?


\b(?i:[0-9a-z]+(\.[0-9a-z]+)+)\b

should do the trick.

--
Jesse Houwing
jesse.houwing at sogeti.nl


.



Relevant Pages

  • Re: Extracting Strings
    ... regular expression and php function that does it. ... I want to extract the data in the following string: ... The characters in the square brackets are the characters to match ...
    (alt.php)
  • Re: Extracting Strings
    ... regular expression and php function that does it. ... I want to extract the data in the following string: ... The characters in the square brackets are the characters to match ...
    (alt.php)
  • Re: Extracting a numbers from a text string
    ... thorough understanding of the application's potential. ... The Regular Expression is the section within the double quote marks. ... Look for a space (but don't extract it) ... a string of digits ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Extracting Strings
    ... regular expression and php function that does it. ... I want to extract the data in the following string: ...
    (alt.php)
  • Regex help
    ... the string I extract must have: ... the fullstops most be in the middle of it. ... what kind of regular expression would I write to extract 'host.domain.name'? ...
    (microsoft.public.dotnet.languages.csharp)

Quantcast