Are there any good / interesting analogs to regular expressions in 2d?

Not being a regex expert, but finding the problem interesting, I looked around and found this interesting blog entry. Especially the syntax used there for defining the 2D regex looks appealing. The paper linked there might tell you more than me. Update from comment: Here is the link to the primary author’s page where you … Read more

Regex difference: (\w+)? and (\w*)

(\w+)? and (\w*) both match the same (0..+inf word characters) However, there is a slight difference: In the first case, if this part of the regex matches “”, the capturing group is absent. In the second case, it is empty. In some languages, the former manifests as a null while the latter should always be … Read more

Remove everything except a certain pattern

In order to remove anything but a specific text, you need to use .*(text_you_need_to_keep).* with . matching a newline. In Notepad++, use        Find: .*(phone=\S*?digits=1).* Replace: $1 NOTE: . matches newline option must be checked. I use \S*? instead of .* inside the capturing pattern since you only want to match any non-whitespace characters as few … Read more

Regex – match everything but forward slash

What about something like this? ^/([^/]+)/?(.*)$ I tested it with python and seems to work fine: >>> regex=re.compile(r’^/([^/]+)/?(.*)$’) >>> regex.match(‘/seattle’).groups() (‘seattle’, ”) >>> regex.match(‘/seattle/restaurant’).groups() (‘seattle’, ‘restaurant’)

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)