Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

What does this regex do?

Last post 07-25-2008, 8:01 AM by prometheuzz. 2 replies.
Sort Posts: Previous Next
  •  05-20-2008, 3:06 PM 42425

    What does this regex do?

     Hello there, I have come across this regex I have tried my best to understand but no luke so far. Would anyone translate it to English words what is it trying to achive?
     
    (?<=(?:^| ))[a-z]
     
     Thanks,
    hope 
  •  05-20-2008, 4:11 PM 42426 in reply to 42425

    Re: What does this regex do?

    Making several assumptions about what options are and aren't on and assuming the language you are trying to do this in supports lookbehinds.  It's trying to match the first letter of a word.

    Assumptions: IgnoreCase ON, IgnoreWhitespace OFF

    if IgnoreCase is false then it only matches the first letter of words in lowercase.


    Michael

    "In theory, theory and practice are the same. In practice, they are not."
    Albert Einstein
  •  07-25-2008, 8:01 AM 44563 in reply to 42425

    Re: What does this regex do?

    It matches any lowercase character of the set 'a' to 'z' which has a whitespace before it, or is at the start of your string.

    So, from the String "abc Def ghi", it matches the 'a' and 'g'.
     

View as RSS news feed in XML