Jump to content

Recommended Posts

  • 7 months later...

I've just made a simple workflow to test whether a Regular Expression matches a given string.

 

Screen%20Shot%202013-05-01%20at%2015.25.

 

You type the match keyword followed by the regex to test against everything that comes after.

 

I hope someone else find it useful.

 
Here's the download link: http://cl.ly/Og94

 

Any bug or feature requests, please ping me at https://twitter.com/samflores.

 

Hi mate.

I'm not using twitter so i'll do a feature request here.

This workflow could be very useful to me if it worked the other way around. I'm not sure if it's a good idea or even possible at all, but for regex newbies as my self, it'd help a lot!

How about typing like "match 13,99" and the workflow would then output a regex string which will match the input? Imo that would make the workflow amazing :)

 

Good work though :)

Link to comment

How about typing like "match 13,99" and the workflow would then output a regex string which will match the input? Imo that would make the workflow amazing :)

 

This should be more obvious, but that would be virtually impossible to do. If you said "match 13,99" what pattern exactly are you matching?

  • 5 characters of any sort?
  • 2 characters of any sort + any punctuation mark + 2 characters of any sort?
  • 2 numbers + comma + 2 numbers?
  • Any number of numbers + (period or comma or semicolon) + any number of characters?

There are simply too many patterns that could match that output, and without human intervention, no software would know which one satisfies your needs. But it's a lovely idea.  ;)

Link to comment

This should be more obvious, but that would be virtually impossible to do. If you said "match 13,99" what pattern exactly are you matching?

  • 5 characters of any sort?
  • 2 characters of any sort + any punctuation mark + 2 characters of any sort?
  • 2 numbers + comma + 2 numbers?
  • Any number of numbers + (period or comma or semicolon) + any number of characters?

There are simply too many patterns that could match that output, and without human intervention, no software would know which one satisfies your needs. But it's a lovely idea.  ;)

 

Oh well that makes a lot of sense. Thanks for elaborating! Perhaps i should stop being lazy and just RTFM! 

Link to comment

This appears to be broken now... at least for me. Getting this in Console.app:

 

12/13/13 4:17:26.893 AM Alfred Workflow[86420]: invalid byte sequence in US-ASCII (ArgumentError) [query: (\d+)[.,](\d+) R$ 13,99]
  ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.CEDCD1E4-EE40-4BB5-8711-636173060637/ruby-1.8/gems/plist-3.1.0/lib/plist/parser.rb:91:in `scan'
  ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.CEDCD1E4-EE40-4BB5-8711-636173060637/ruby-1.8/gems/plist-3.1.0/lib/plist/parser.rb:91:in `parse'
  ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.CEDCD1E4-EE40-4BB5-8711-636173060637/ruby-1.8/gems/plist-3.1.0/lib/plist/parser.rb:29:in `parse_xml'
  ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.CEDCD1E4-EE40-4BB5-8711-636173060637/alfred.rb:21:in `plist'
  ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.CEDCD1E4-EE40-4BB5-8711-636173060637/alfred.rb:26:in `bundle_id'
  ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.CEDCD1E4-EE40-4BB5-8711-636173060637/alfred.rb:10:in `initialize'
Link to comment
  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...